假定用户表user中存在一个字段age,现要 "查询年龄为18或20的用户" ,下面SQL语句中,正确的是
select * from user where age = 18 or age = 20;
举一反三
- 已知用户表user中存在字段count,现要查询count字段值为null的用户,下面SQL语句中正确的是
- 假定users表中存在一个年龄字段age,下面选项中,能够获得最小年龄值的SQL语句是
- 要建立一个约束,保证用户表(user) 中年龄(age) 必须在16岁以上,下面语句正确的是( )。
- 假定用户表user有多列,其中字段id中没有null值,字段username中存在null值。下面选项中,不能获得user表的总记录数的SQL语句是
- 用户表user中存在一个名字字段username,现查询名字字段中包含"凤"的用户,下列SQL语句中,正确的是() A: select * from user where username = '凤'; B: select * from user where username like '%凤%'; C: select * from user where username like '_凤_'; D: select * from user where username like '凤';
内容
- 0
假定users表中存在一个年龄字段age,下面选项中,能够获得最小年龄值的SQL语句是 A: selectmin(age)fromusers; B: selectagefromusersorderbyageasclimit1,1; C: selectmax(age)fromusers; D: selectagefromusersorderbyageasclimit0,1;
- 1
在SQL语句中要查询表s在AGE字段上取空值的记录,正确的SQL语句为:SELECT*FROMsWHERE()。
- 2
假定user表中有一个username字段。 下面选项,可以给username字段添加一个un别名的SQL语句是
- 3
已知有一张user表,表中有字段id、name、age、sex、address。请写出两种查询表中所有字段信息的SQL语句
- 4
假定用户表user有多列,其中字段id中没有null值,字段username中存在null值。下面选项中,不能获得user表的总记录数的SQL语句是( ) A: select count(*) from user; B: select count(id) from user; C: select count(username) from user; D: select count(id) from user where1=1;