如果QUANTITY的值为空值(null),在执行以下哪个语句时会显示一个0
A: SELECT id_number, 100/quantity
B: FROM
C: inventory;
D: SELECT id_number, NVL(100/quantity, 0)
E: FROM
F: inventory;
G: SELECT id_number, NULL(100/quantity, 0)
H: FROM
I: inventory;
J: SELECT id_number, TO_CHAR(100/quantity, 0)
K: FROM
L: inventory;
M: SELECT id_number, NVL(100/quantity, ’999.00’)
N: FROM
O: inventory;
A: SELECT id_number, 100/quantity
B: FROM
C: inventory;
D: SELECT id_number, NVL(100/quantity, 0)
E: FROM
F: inventory;
G: SELECT id_number, NULL(100/quantity, 0)
H: FROM
I: inventory;
J: SELECT id_number, TO_CHAR(100/quantity, 0)
K: FROM
L: inventory;
M: SELECT id_number, NVL(100/quantity, ’999.00’)
N: FROM
O: inventory;
举一反三
- create table t(id int not null, a int default 0, b int default 0, c int default 0, primary key(id), key idx_a_b(a, b));下面语句能够利用到索引的是() A: select b from t where a=10; B: select * from t where a=10 and id=100; C: select * from t where a=10 and b>100; D: select * from t where a>10 and b < 100; E: select * from t order by b limit 10;
- 下面用于查询student表中id值在1,2,3范围内的记录的SQL语句是( )。 A: SELECT * FROM student WHERE id=1,2,3; B: SELECT * FROM student WHERE (id=1,id=2,id=3); C: SELECT * FROM student WHERE id in (1,2,3); D: SELECT * FROM student WHERE id in 1,2,3;
- “select * from article where id>=100”语句的功能是在“article”表中查询“id”大于100的记录。
- 已知用户表 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 WHERE 1=1;
- 假定用户表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;