题目内容

现有学生关系表S(sno,sname,ssex,sage),查找年龄为空值的女生信息的SQL语句是________。

A. select*fromSwheressex='女'andsage=Null;
B. select*fromSwheressexis'女'andsageisNull;
C. select*fromSwheressex='女'andsageisNull;
D. select*fromSwheressexis'女'andsage=Null;

查看答案
更多问题

现有学生关系表S(sno,sname,ssex,sage),查找所有姓"陈"的男生姓名信息的SQL语句是________。

A. selectsnamefromSwheressex='男'andsnamelike'陈';
B. selectsnamefromSwheressex='男'andsnamelike'陈_';
C. selectsnamefromSwheressex='男'andsname='陈%';
D. selectsnamefromSwheressex='男'andsnamelike'陈%';

现有学生关系表S(sno,sname,ssex,sage),查找所有男生和女生的平均年龄信息,对应的SQL语句是________。

A. select ssex, avg(sage) fromS where ssex in('男', '女');
B. select ssex, avg(sage) fromS group by ssex;
C. select ssex, avg(sage) fromS;
D. select ssex, avg(distinct sage) fromS group by ssex;

在学生关系表S(sno,sname,ssex,sage)上查找各年龄段的学生人数,显示总人数在10人以上的年龄段并按人数多少降序排列,对应的SQL语句是________。

A. select sage, count(*) from S where count(*)>10 group by sage order by count(*) DESC;
B. selectsage,count(*)人数fromSwheresum(*)>10orderby人数DESC;
C. selectsage,count(*)人数fromSgroupbysagehavingsum(*)>10orderby人数DESC;
D. selectsage,count(*)人数fromSgroupbysagehavingcount(*)>10orderby人数DESC;

现有学生关系表S(sno,sname,ssex,sage),查找年龄大于20岁的男生和女生人数信息,对应的SQL语句是________。

A. selectssex,count(*)fromSwheresage>20;
B. selectssex,count(*)fromSgroupbyssexhavingsage>20;
C. selectssex,count(*)fromSwheresage>20groupbyssex;
D. selectssex,count(*)fromSwheresage>20groupbyssex having sage>20;

答案查题题库