已知 student 表有姓名字段 name。若想查询所有姓“王”的学生,并且姓名由三个字符组成,则应使用的SQL 语句是
A: SELECT* FROM student WHERE name LIKE ‘王__’;
B: SELECT* FROM student WHERE name LIKE ‘王%_’;
C: SELECT* FROM student WHERE name LIKE ‘王%’;
D: SELECT* FROM student WHERE name =’王__’;
A: SELECT* FROM student WHERE name LIKE ‘王__’;
B: SELECT* FROM student WHERE name LIKE ‘王%_’;
C: SELECT* FROM student WHERE name LIKE ‘王%’;
D: SELECT* FROM student WHERE name =’王__’;
举一反三
- 已知 student 表有姓名字段 name ,并且存在 name 为’sun%er’的记录。下列选项中,以匹配“ sun%er ”字段值的 SQL 语句是 A: SELECT * FROM student WHERE name LIKE ‘sun%er’; B: SELECT * FROM student WHERE name LIKE ‘%%%’; C: SELECT * FROM student WHERE name LIKE '%\%%'; D: SELECT * FROM student WHERE name =‘sun%er’;
- 若想查询student表中name为空值的记录,则正确的SQL语句是( )。 A: SELECT * FROM student WHERE name = NULL; B: SELECT * FROM student WHERE name like NULL; C: SELECT * FROM student WHERE name = 'NULL'; D: SELECT * FROM student WHERE name is NULL;
- 下面查询语句中哪条查询语句会查询出所有包含"李"的数据? A: select * from student where name limit‘%李%’ B: select * from student where name =‘%李%’ C: select * from student where name like‘%李%’ D: select * from student where name in‘%李%’
- 若想查询student表中name为空值的记录,则正确的SQL语句是(1.0分) A: select * from student where name = null; B: select * from student where name link null; C: select * from student where name = 'null'; D: select * from student where name is null;
- 使用SQL语句从表STUDENT中查询所有姓王的同学的信息,正确的命令是: A: SELECT*FROM STUDENT WHERE LEFT(姓名,2)="王" B: SELECT*FROM STUDENT WHERE RIGHT(姓名,2)="王" C: SELECT*FROM STUDENT WHERE TRIM(姓名,2)="王" D: SELECT*FROM STUDENT WHERE STR(姓名,2)="王"