下列哪个查询语句属于列级子查询?
A: select*fromstudentswhereage>(selectavg(age)fromstudents);
B: selectnamefromclasseswhereidin(selectcls_idfromstudents);
C: select*fromstudentswhere(heght,age)=(selectmax(heght),max(age)fromstudents);
A: select*fromstudentswhereage>(selectavg(age)fromstudents);
B: selectnamefromclasseswhereidin(selectcls_idfromstudents);
C: select*fromstudentswhere(heght,age)=(selectmax(heght),max(age)fromstudents);
举一反三
- 下面 语句和”select * from student where sex=’男’ && age=20;”语句查询出的结果是一样的。( ) A: select * from student where sex=’男’ or age=20; B: select * from student where sex=’男’ || age=20; C: select * from student where sex=’男’ and age=20; D: select * from student where sex,age in(’男’,20);
- 下列SQL语句中,能够完成求某列最大值的是()。 A: SELECT AVG(Age) FROM Student B: SELECT MAX(Age) FROM Student C: SELECT MIN(Age) FROM Student D: SELECT COUNT(*) FROM Student
- 数据库中有一张表名称为Student,有列Name,Age,IDCard,Sex。要求写SQL语句查询出表中年龄介于20和30岁之间的数据,下列哪个SQL语句是正确的?() A: Select* From Student Where Age>=20 ANDAge>=30 B: Select* From Student Where Age>=20 ANDAge<=30 C: Select* From Student Where Age BET WENN 20AND30 D: Select* From Student Where Age>=20&&Age>=30"
- 假定有学生关系S,结构为S(SID, SNAME, AGE),其中SID为学号,SNAME为姓名,AGE为年龄。查询所有比“李军”年龄大的学生的姓名、年龄,正确的SQL语句是( )。 A: SELECT SNAME, AGE FROM S WHERE AGE > ( SELECT AGE FROM S WHERE SNAME = '李军' ) B: SELECT SNAME, AGE FROM S WHERE AGE >( SNAME= '李军' ) C: SELECT SNAME, AGE FROM S WHERE AGE > ( SELECT AGE WHERE SNAME='李军' ) D: SELECT SNAME, AGE FROM S WHERE AGE>李军.AGE
- select ________ from student;查询student表中age列的总和,全部小写。