『壹』 数据库SQL查询语句题目,求大神帮忙~
(6)select学号,姓名from学生表a,选课表bwherea.学号=b.学号
and课程号'5'
(7)select学号from选课where课程号notin('5')
(8)select学号from选课where课程号in('5','6')
(9)select学号,姓名from学生表a,选课表bwherea.学号=b.学号
and课程号in(select课程号from课程表)
(10)select学号,姓名from学生表a,选课表bwherea.学号=b.学号
and课程号in(select课程号from选课表where学号='95001')
『贰』 数据库SQL语句考试
insert into A values('010102','张静',‘抄’袭,‘’,‘机电’)
update C set GRADE='59' where GRADE>=60
delete from A where SN like '李%'
select S#,SEX,AGE from A where SN='刘华'
select A.S#,CN from A,B,C where A.S#=C.S# and C.C#=B.C# and A.DEPT not in ('计算机系','法律系')
select C.S#,sum(GRADE) from C where C.S# in (select C.S# from B,C where B.CN='大学语文' and B.C#=C.C#) order by sum(GRADE) desc
update A set SEX='',AGE=''
drop table A
drop table B
drop table C
『叁』 SQL数据库语句大全
SQL数据库语句大全:
1、选择:select * from table1 where 范围
2、插入:insert into table1(field1,field2) values(value1,value2)
3、删除:delete from table1 where 范围
4、更新:update table1 set field1=value1 where 范围
5、排序:select * from table1 order by field1,field2 [desc]
6、总数:select count as totalcount from table1
7、求和:select sum(field1) as sumvalue from table1
『肆』 数据库select语句练习题啊!!!
10.题答案抄
select 课程号袭,总分,平均分,最高分,最低分(
select 课程号,
总分=sum(成绩),
平均分=sum(成绩)/count(*),
最高分=max(成绩),
最低分=min(成绩)
from 成绩
group by 课程号) as kc order by 平均分 desc
11.题答案
select 课程号,
平均分=sum(成绩)/count(*)
from 成绩
where 课程号='1001' or 课程号='1002'
group by 课程号
12.题答案
select 姓名,xs.学号,kc.平均分
from 学生 as xs
left join (select 学号,
平均分=sum(成绩)/count(*)
from 成绩
group by 学号) as kc on kc.学号=xs.学号
where kc.平均分>80