『壹』 資料庫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