在MySQL中,查看学生表Students表中的姓名Sname属性的SQL语句表达正确的是( )。
A: SELECT * FROM Students
B: SELECT * FROM Students WHERE Sname=""
C: SELECT Sname FROM Students
D: SELECT Sname FROM Students WHERE Sname=""
A: SELECT * FROM Students
B: SELECT * FROM Students WHERE Sname=""
C: SELECT Sname FROM Students
D: SELECT Sname FROM Students WHERE Sname=""
举一反三
- 【多选题】在MySQL中,学生表Students中包含学号sid(主键)、姓名sname。现在查询所有有重名的学生姓名,以下语句正确的是()。 A. select sname from students group by sid having count(sid)>1; B. select sname from students group by sname having count(sid)>1; C. select distinct a.sname from students A, students B where A.sname=B.sname; D. select distinct a.sname from students A, students B where A.sname=B.sname and A.sid !=B.sid;
- 查找学生表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 S#,SNAME FROM S WHERE SNAME=’李%’ B: SELECT S#,SNAME FROM S WHERE SNAME LIKE ’李%’ C: SELECT S#,SNAME FROM S WHERE SNAME=’%李%’ D: SELECT S#,SNAME FROM S WHERE SNAME LIKE ’%李%’
- 在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 '%[大小]%'
- 查询姓"张"的学生姓名,下列()语句不能实现。 A: SELECT sname FROM student WHERE left(sname,1)= '张' B: SELECT snameFROM student WHERE sname LIKE '张%' C: SELECT sname FROM student WHERE substring(sname,1,1)= '张' D: SELECT sname FROM student WHERE sname='张%'