全國計算機二級(vf)sql語句練習(xí)5

字號:

5. 統(tǒng)計選修了課程的人數(shù)(選修多門時,只計算),統(tǒng)計結(jié)果保存在一個新表new_table中,表中只有一個字段:學(xué)生人數(shù)
    select count(distinct(學(xué)號)) 學(xué)生人數(shù) from score1 into dbf NEW_TABLE
    查詢沒有學(xué)生選修的課程,查詢結(jié)果含課程名,開課單位,結(jié)果按課程名勝虛保存在new_tabale2中
    select 課程名,開課單位 from course ;
    where 課程號 not in (select distinct 課程號 from score1) order by 課程名 into dbf NEW_TABLE2