对于学生信息表: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
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
- 有学生信息表student,求年龄在20~22岁之间(含20岁和22岁)的学生姓名和年龄的SQL语句是:SELECT sname,age FROM student WHERE age( )。 A: >20 and age<22 B: BETWEEN 20 AND 22 C: >=20 and age<22 D: >20 and age<=22
- 对于学生信息表:student(sno,sname,sex,age,dept),要查询所有刘姓学生的信息,正确的语句是 A: SELECT * FROM student WHERE sname LIKE'刘 * ' B: SELECT * FROM student WHERE sname LIKE'刘 $' C: SELECT * FROM student WHERE sname LIKE'刘%' D: SELECT * FROM student WHERE sname LIKE'刘&'
- 查找学生表student中姓名的第二个字为“t”的学生学号sno和姓名sname,下面SQL语句正确的是()。 A: SELECT sno, sname FROM student WHERE sname='_t%'; B: SELECT sno, sname FROM student WHERE sname LIKE '_t%'; C: SELECT sno, sname FROM student WHERE sname='%t_'; D: SELECT sno, sname FROM student WHERE sname LIKE '%t_';
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,SQL语句可为( ) A: SELECT DISTINCT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; B: SELECT Sno, Sname FROM Student, SC WHERE Student.Sno = SC.Sno; C: SELECT DISTINCT Sno, DISTINCT Sname FROM Student WHERE Student.Sno IN (SELECT Sno FROM SC); D: SELECT Sno, Sname FROM Student WHERE Student.Sno IN (SELECT DISTINCT Sno FROM SC);