下列 SQL 语句select * from student where sno = '05880101'union select * from student where sno = '05880102'与此查询语句等价的选项是( )。
A: select * from student where sno= '05880101' and sno= '05880102'
B: select * from student where sno= '05880101' or sno= '05880102'
C: select * from student where sno= '05880101'
D: select * from student where sno= '05880102'
A: select * from student where sno= '05880101' and sno= '05880102'
B: select * from student where sno= '05880101' or sno= '05880102'
C: select * from student where sno= '05880101'
D: select * from student where sno= '05880102'
举一反三
- select * from student where sno=’05880101’ union select * from student where sno=’05880102’ 与此查询语句等价的选项是( )。
- 在学生选课数据库中,查询选修了课程的学生的学号、姓名,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);
- 查找学生表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_';
- 对于学生信息表: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
- 查询曾经考过100分的学生的学号,可以使用的SQL语句是:( ) A: SELECT ALL Sno FROM SC WHERE Grade = 100; B: SELECT DISTINCT Sno FROM SC WHERE Grade = 100; C: SELECT ALL Sno FROM Student WHERE SGrade = 100; D: SELECT DISTINCT Sno FROM Student WHERE SGrade = 100;