题目内容

在学生关系student(sid,xb……)中,student的属性分别表示学号和性别,若要统计student表中男、女学生的人数,下列SQL语句正确的是( )。

A. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student GROUP BY sid
B. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student GROUP BY xb
C. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student ORDER BY sid
D. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student ORDER BY xb

查看答案
更多问题

有关系S(sid,sname,sage),C(cid,cname),SC(sid,cid,grade)。要查询选修“数据库技术”课程且年龄不小于20的全体学生的姓名的SQL语句是“SELECT sname FROM S,C,SC WHERE”,这里WHERE子句的内容是( )。

A. S.sid=SC.sid AND C.cid=SC.cid AND sage>=20 AND cname='数据库技术'
B. S.sid=SC.sid AND
C. cid=SC.cid AND sage IN 20 AND cname IN '数据库技术'C.S.sid=SC.sid AND sage>=20 AND cname='数据库技术'
D. C.cid=SC.cid AND sage IN 20 AND cname IN '数据库技术'

在学生关系student(sid,sname,nid)中,student的属性分别表示学号、姓名和民族编号,若要查询与张海是同一民族的学生的姓名,下列SQL语句正确的是( )。Ⅰ.SELECT s2.sname AS '姓名' FROM student s1,student s2 WHERE s1.nid=s2.nid AND s1.sname='张海'Ⅱ.SELECT sname AS '姓名' FROM student WHERE nid IN(SELECT nid FROM Student WHERE sname='张海')

A. Ⅰ
B. Ⅱ
C. Ⅰ、Ⅱ
D. Ⅰ、Ⅱ均不正确

在学生信息表student中,求年龄在20~22岁之间(含20岁和22岁)的学生姓名和年龄的SQL语句是:SELECT sname,age FROM student WHERE age____20 AND 22。

SELECT语句中,使用____子句可按指定列的值进行分组。

答案查题题库