查找学生表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_';
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);
- 若要求查找Student表中,姓名的第二个字为''刘''的学生学号和姓名。下面列出的SQL语句中,哪个是正确的( ) A: SELECT Sno,SNAME FROM S WHERE SNAME=′_刘%′ B: SELECT Sno,SNAME FROM S WHERE SNAME LIKE′%刘%′ C: SELECT Sno,SNAME FROM S WHERE SNAME LIKE′_刘%′ D: 全部
- 若要求查找Student表中,姓名的第二个字为''刘''的学生学号和姓名。下面列出的SQL语句中,哪个是正确的( ) A: SELECT Sno,SNAME FROM S WHERE SNAME=′_刘%′ B: SELECT Sno,SNAME FROM S WHERE SNAME LIKE′%刘%′ C: SELECT Sno,SNAME FROM S WHERE SNAME LIKE′_刘%′ D: 全部
- 在student(sno,sname,ssex,sage,sdept)表中,查询学生姓名中包含“大”或“小”的学生信息。以下查询语句正确的是( )。 A: select * from student where sname in( '_[大小]%') B: select * from student where sname ='%大%' or sname='%小%' C: select * from student where sname like'%大%' or sname like'%小%' D: select * from student where sname like '%[大小]%'
- S_T数据库关系图如下:[img=332x128]17e448fc85e997f.jpg[/img]查询与“刘晨”在同一个系学习的学生,要求显示学生学号(Sno)、姓名(Sname)及系别(Sdept)。下列SQL语句正确的是()。 A: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept = (SELECT Sdept FROM Student WHERE Sname = '刘晨'); B: SELECT S1.Sno, S1.Sname , S1.Sdept FROM Student S1 , Student S2 WHERE S1.Sdept = S2.Sdept AND S2.Sname = '刘晨'; C: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept IN (SELECT Sdept FROM Student WHERE Sname = '刘晨'); D: SELECT Sno, Sname, Sdept FROM Student WHERE Sdept LIKE (SELECT Sdept FROM Student WHERE Sname = '刘晨');