String sql="select * from stu_info where name=+key+"; 该条语句的作用是?
举一反三
- String sql="select * from stu_info where name='"+key+"'"; 该条语句的作用是? A: 查询stu_info表中所有记录 B: 查询stu_info表中姓名为key的记录 C: 查询stu_info中name字段与关键字key相同的记录
- 下面选项中,查询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;
- 根据用户在文本框txtName中输入的姓名对Student表进行查询,以下SQL语句定义正确的是__________________。 A: String sql=Select * from Student where Sname=+txtName.getText(); B: String sql=Select * from Student where Sname='+txtName.getText()+'; C: String sql=Select * from Student where Sname like +txtName.getText(); D: String sql=Select * from Student where Sname like '+txtName.getText()+';
- 若想查询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 stu WHERE stuname='_金_' B: SELECT * FROM stu WHERE stuname='%金%' C: SELECT * FROM stu WHERE stuname like '_金_' D: SELECT * FROM stu WHERE stuname like '%金%'