【文章內(nèi)容簡(jiǎn)介】
[ GROUP BY [ ALL ] group_by_expression [ ,...n ] [ WITH { CUBE | ROLLUP } ] ] [HAVING search_condition][實(shí)驗(yàn)內(nèi)容及步驟]一、數(shù)據(jù)查詢(xún)1.投影查詢(xún)l 查詢(xún)學(xué)生表中所有記錄的姓名、性別、班號(hào)Select sname,ssex,sclass from student l 查詢(xún)教師表中所有的單位Select distinct depart from teacher2.選擇查詢(xún)l 查詢(xún)性別為‘女’或年齡在20歲的學(xué)生記錄Select * from studentWhere ssex=’女’or sage=20l 查詢(xún)成績(jī)?yōu)?5或86的記錄Select * from scoreWhere degree in (85,86)l 以班號(hào)降序顯示學(xué)生表的所有記錄Select * From studentOrder by sclass descl 查詢(xún)各門(mén)課程的最高分Select o,max(degree)From scoreWhere not degree is nullGroup by ol 查詢(xún)所有學(xué)生的學(xué)號(hào)、選修的課程號(hào)及成績(jī)Select sno,ame,degreeFrom score,courseWh