请练习以下语句,用文字说明其执行的功能 -- select 人数=count(studentid) from students -- select 人数=count(studentid),sclass from students group by sclass -- select 人数=count(studentid),ssex from students group by ssex -- select 人数=count(*),sclass,ssex from students group by ssex,sclass --查询成绩表中各个科目的最高分(要显示科目ID) (写语句) -- select A.sname,B.score,C.Cname,A.sclass from score as B, students as A,course as C where A.studentID=B.studentID and B.courseID=C.courseID -- select A.sname,B.score,B.courseID from students as A left outer join score as b on A.studentID=B.studentID -- select A.sname,B.score,B.courseID from students as A right outer join score as b on A.studentID=B.studentID -- use bbs select s.sname,c.score,c.courseid from score as c inner join students as s on s.studentID=c.studentID where s.sname='刘邦' -- select s.sname,c.courseid,c.score from students as s,score as c where s.studentid=c.studentid -- select c.studentid,a.cName,c.score from score as c inner join course as a on c.courseid=a.courseid where studentid like '2010012[0-1]' |
|
来自: 教育电力 > 《SQL 2005》