• 2022-06-15
    下面哪条语句可以查询姓“张”并且年龄等于20岁的用户,请问用哪条语句?
    A: Select * From table Where name like "%张%" And intAge=20
    B: Select * From table Where name like "张%" And intAge=20
    C: Select * From table Where name like "张%" And intAge="20"
    D: Select * From table Where name="张" And intAge=20
  • B

    举一反三

    内容

    • 0

      在学生表STUD中查询所有姓张的学生的信息,使用的SQL语句是______。 A: SELECT*FROM STUD WHERE 姓名 LIKE"张%” B: SELECT*FROM STUD WHERE 姓名 IN("张%") C: SELECT*FROM STUD WHERE 姓名 LIKE"张$" D: SELECT*FROM STUD WHERE 姓名 IN"张$)"

    • 1

      若想查询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;

    • 2

      已知 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’;

    • 3

      检索所有姓“张”、姓“田”的学生信息,可以使用的SQL语句有______。 A: SELECT * FROM student WHERE student_name LIKE( '张%' OR '田%'); B: SELECT * FROM student WHERE SUBSTRING(student_name,1,1) in ('张','田'); C: SELECT * FROM student WHERE SUBSTRING(student_name,1,1)= '张' OR SUBSTRING(student_name,1,1)='田'; D: SELECT * FROM student WHERE student_name LIKE '张%' OR student_name LIKE '田%';

    • 4

      查询姓"张"的学生姓名,下列()语句不能实现。 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='张%'