题目1单选题
各位同学注意,该题包括单选和多选.下面的所有题都采用如下表结构,请记录下面的表结构.(下面的题目中将不提供表结构了,需要提前记录) <img src="https://tihai-oss-cloud.itihey.com/img/c0b669c40d89fa89a254bd1d537f5b0c.png"> (1)求年龄大于20岁的男学生姓名、系和年龄; (10.0)A. SELECT SNAME, SPEC, AGE FROM ST WHERE AGE>20B. SELECT SNAME, SPEC, AGE FROM ST WHERE AGE>20 AND SEX='男'C. SELECT SNAME, SPEC, AGE FROM ST WHERE AGE>20 OR SEX='男'D. SELECT SNAME, SPEC, AGE FROM ST WHERE SEX='男'
题目3单选题
求课程号为2学生的平均成绩,最高成绩.(10.0)A. select cno, max(grade), avg(grade)from sc where cno='2'B. select cno, sum(grade), avg(grade)from sc where cno='2'C. select max(grade), avg(grade)from sc where cno='2'D. select cno, count(grade), avg(grade)from sc where cno='2'
题目6多选题
•求年龄大于19岁的非计算机应用专业,姓名含有"李"的男学生姓名、系和年龄.(10.0)A. SELECT SNAME, SPEC,AGEFROM STWHERE SNAME LIKE '%李%'ANDAGE>19 AND SPEC NOT IN('计算机应用')AND SEX='男'B. SELECT SNAME, SPEC,AGEFROM STWHERE SNAME LIKE '李%'ANDAGE>19 AND SPEC NOT IN('计算机应用')AND SEX='男'C. SELECT SNAME, SPEC,AGEFROM STWHERE SNAME LIKE '%李%'ANDAGE>19 AND SPEC!='计算机应用'AND SEX='男'D. SELECT SNAME, SPEC,AGEFROM STWHERE SNAME LIKE '%李%'ANDAGE>19 AND SPEC!='计算机应用'
题目7多选题
求各系中年龄大于18岁的除计算机软件专业之外的各专业人数.(10.0)A. select spec,count(*)from ST where age>18group by spec having spec!='计算机软件'B. select sno,spec,count(*)from ST where age>18group by spec having spec!='计算机软件'C. select spec,count(*)from ST where age>18 and spec!='计算机软件'group by specD. select spec,count(*)from ST where age>18 and spec!='计算机软件'
题目8多选题
各系中各专业的人数,并要求专业人数小于5.(10.0)A. select sdept, count(*)from STgroup by sdept having count(*)<5B. select sno,sdept,spec, count(sno)from STgroup by sdept,spec having count(sno)<5C. select sdept,spec, count(*)from STgroup by sdept,spec having count(*)<5D. select sdept,spec, count(sno)from STgroup by sdept,spec having count(sno)<5