用資料庫幾條命令實現查詢?

  • 作者:由 匿名使用者 發表于 文化
  • 2022-10-11

用資料庫幾條命令實現查詢?雪仔2010.11.18 回答

7, select * from 成績表 where 成績 > (select avg(成績) from 成績表)

8, select * from 學生表 ,(select 學號 from 成績表 where 成績 is  null)a where 學生表。學號=a。學號  ——汗,非要使用比較符,

9, select * from 學生表 where 學號 not  in (select 學號 from 成績表) ——not in 也算in關鍵符吧,汗

10, select * from 課程表 where 課程號 not in (select 課程號 from 成績表)

11,select * from 學生表  ,成績表 where 學生表。學號=成績表。學號 and 成績 > any (select 成績 from 成績表,課程表 where 成績表。課程號=課程表。課程號 and (任課老師=‘王老師’ or 任課老師=‘李老師’))

12,select * from 學生表  ,成績表 where 學生表。學號=成績表。學號 and 成績 < all (select isnull(成績,0) from 成績表,課程表 where 成績表。課程號=課程表。課程號 and (任課老師=‘王老師’ or 任課老師=‘李老師’))

Top