网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

根据SQL标准,要查询表student中平均年龄age小于21的所在系dept及其平均年龄值,下面哪条语句适用?()

A select dept,avg(age) from student where avg(age)<21

B select dept,avg(age) from student group by dept having avg(age)<21

C select dept,avg(age) from student having avg(age)<21

D select dept,avg(age) from student group by dept where avg(age)<21


参考答案

更多 “ 根据SQL标准,要查询表student中平均年龄age小于21的所在系dept及其平均年龄值,下面哪条语句适用?()A select dept,avg(age) from student where avg(age)B select dept,avg(age) from student group by dept having avg(age)C select dept,avg(age) from student having avg(age)D select dept,avg(age) from student group by dept where avg(age) ” 相关考题
考题 设有学生数据库:student(sno,sname,sex,age,dept)。现要查询所有刘姓学生的信息,可使用如下的 SQL语句:SELECT*FROM student WHERE【 】。

考题 根据SQL标准,删除表student中对字段sno的唯一性约束,应该使用下面哪条语句? ()A drop sno from table studentB alter table student drop snoC alter table student drop unique(sno)D alter table student drop sno unique

考题 根据SQL标准,要修改表student中所有学生的年龄age,使之在原值基础上减一,下面哪个语句适用?()A update student set age = 1B update student set age = age - 1C update age = age -1 from studentD update from student where age = age -1

考题 根据SQL标准,增加一条记录到表student,学号sno是11301,姓名sname是“snoopy”,年龄age是20。其中student表中包括学号、姓名、年龄、籍贯、系别等属性,并且属性除sno外皆可取空值。下面哪条是参考的?()A insert into student values(sno=11301, sname=’snoopy’, age =20)B insert into student(sno,sname,age) values(11301,’snoopy’,20)C insert into student set sno=11301, sname=’snoopy’, age = 20D insert into student values (11301, ’snoopy’, 20)

考题 根据SQL标准,创建一个视图abc,通过该视图只能对表student中系dept为‘IS’的记录进行更新操作。下面哪条语句适用?()A create view abc as select * from student where dept=’IS’B create view abc as select * from student where dept=’IS’ with check optionC create view abc as student where dept=’IS’D create view abc as select dept=’IS’ from student

考题 根据SQL标准,下面哪句语句能够找出年龄最小的同学?其中age为学生表student中的年龄字段,sno为学生的学号。()A select max(age) from studentB select sno from student where age = max(age)C select sno from student having age = max(age)D select sno from student a where a.age

考题 根据SQL标准,查询表student(sno,sname,sex,dept)中所有学生的选修课程数,其中选修记录在表SC(sno,cno,grade)中,两表中sno为关联字段。下面哪条语句合适?()A select sno,count(cno) from SCB select sno,count(cno) from studentC select a.sno,count(cno) from student a left outer join SCD select a.sno,count(cno) from SC left outer join student a

考题 根据SQL标准,要查询表student中所有年龄age小于所有学生的平均年龄的记录,下面哪条语句适用?()A select * from student where ageB select * from student having ageC select * from student a where a.ageD select * from student a where (select avg(b.age) from student b ) >= a.age

考题 现有雇员表,结构为:雇员表(雇员号,姓名,所在部门,年龄) 现要统计每个部门的雇员的平均年龄,希望查询结果是按平均年龄从高到低的顺序排列,并且只取平均年龄最高的前3个部门。完成此功能的查询语句为()A.SELECT TOP 3 WITH TIES 所在部门,AVG(年龄) 平均年龄 FROM 雇员表 ORDER BY 平均年龄 descB.SELECT TOP 3 WITH TIES 所在部门,AVG(年龄) 平均年龄 FROM 雇员表 GROUP BY 所在部门C.SELECT TOP 3 WITH TIES 所在部门,AVG(年龄) 平均年龄 FROM 雇员表 GROUP BY 所在部门 ORDER BY 平均年龄D.SELECT TOP 3 WITH TIES 所在部门,AVG(年龄) 平均年龄 FROM 雇员表 GROUP BY 所在部门 ORDER BY 平均年龄 DESC