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