构造多字段按同一关键字查询,如下所示:$sql="select * from student,major where student.major_id=major.major_id"; //构造SQL语句$sql.=" and((stu_name like '%$key%') _____ (stu_no like '%$key%')...."下划线应该填写?
A: and
B: or
C: &&
D: ||
A: and
B: or
C: &&
D: ||
举一反三
- 构造多字段按同一关键字查询,如下所示: $sql="select * from student,major where student.major_id=major.major_id"; //构造SQL语句 $sql.=" and((stu_name like '%$key%') _____[br][/br] (stu_no like '%$key%')...." 下划线应该填写? A: and B: o C: && D:
- 查询student表中id字段值小于5,并且gender字段值为“女”的学生姓名的SQL语句是() A: SELECT name FROM student WHERE id<;5 OR gender='女'; B: SELECT name FROM student WHERE id<;5 AND gender='女'; C: SELECT name FROM student WHERE id<;5 ,gender='女'; D: SELECT name FROM student WHERE id<;5 AND WHERE gender='女';
- 下面选项中,查询stu表中id值不在2和5之间的学生的SQL语句是( )。 A: select * from stu where id != 2,3,4,5; B: select * from stu where id not betwen 5 and 2; C: select * from stu where id not betwen 2 and 5; D: select * from stu where id not in 2,3,4,5;
- 【单选题】查询student表中id字段值小于5,并且gender字段值为“女”的学生姓名的SQL语句是 A. SELECT name FROM student WHERE id<5 OR gender‘女’; B. SELECT name FROM student WHERE id<5 AND gender=‘女’; C. SELECT name FROM student WHERE id<5 ,gender=‘女’; D. SELECT name FROM student WHERE id<5 AND WHERE gender=‘女’;
- 已知 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 =’王__’;