已知学生表student(sid,sname,sex,age0,其各个属性分别表示学号、姓名、性别和年龄,若要从表中检索所有学生的信息,检索结果按年龄由大到小排序,下列SQL语句正确的是( )
A: select * from student order by age
B: select * from student group by age
C: select * from student order by age desc
D: select * from student group by age desc
A: select * from student order by age
B: select * from student group by age
C: select * from student order by age desc
D: select * from student group by age desc
举一反三
- 从student表中查询学生姓名、年龄和成绩,结果按照年龄降序排序,年龄相同的按照成绩升序排序,下面SQL语句正确的是: A: select name, age, score from student order by age desc , score; B: select name, age, score from student order by age , score asc; C: select name, age, score from student order by 2 desc , 3 asc; D: select name, age, score from student order by 1 desc , 2;
- 对于学生信息表:student(sno,sname,sex,age,dept),能够得到年龄在20岁至22岁之间的学生的姓名和学号的语句是( )。 A: SELECT*FROM student WHERE age BETWEEN 20 AND 22 B: SELECT sname,sno FROM student WHERE age BETWEEN 20 AND 22 C: SELECT sname,sno FROM student WHERE age>=20 D: SELECT sname,sno FROM student WHERE age<=22
- 对于学生信息表:student(sno,sname,sex,age,grade),查询学习成绩为空的学生的学号和姓名,下面语句正确的是 A: SELECT sno,sname FROM student WHERE grade=NULL B: SELECT sno,sname FROM student WHERE grade IS NULL C: SELECT sno,age FROM student WHERE grade IS NULL D: SELECT sno,age FROM student WHERE grade=NULL
- 下面 语句和”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);
- 下列选项中,能够按照 score 由高到低显示 student 表中记录的 SQL 语句是 A: SELECT* FROM student ORDER BY score ; B: SELECT* FROM student ORDER BY score ASC ; C: SELECT * FROM student ORDER BY score DESC ; D: SELECT* FROM student GROUP BY score DESC ;