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