题目如下:
If the following SQL statements are executed in the order shown:
CREATE TABLE orders
(order_num INTEGER NOT NULL,
Buyer_name VARCHAR(35),
Amount NUMERIC(5,2));
CREATE UNIQUE INDEX idx_orderno ON orders(order_num);
Which of the following describes the resulting behavior?
A. Every ORDER_NUM value entered must be unique; whenever the ORDERS table is queried rows should be displayed in order of increasing ORDER_NUM values
B. Every ORDER_NUM value entered must be unique; whenever the ORDERS table is queried rows will be displayed in no particular order
C. Duplicate ORDER_NUM values are allowed; no other index can be created for the ORDERS table that reference the ORDER_NUM column
D. Every ORDER_NUM value entered must be unique; no other index can be created for the ORDERS table that reference the ORDER_NUM column
答案: A 个人总认为应该选B.
原因: 个人找了个表测试了一下,发现只有select order_num from orders 的时候才能按照顺序显示(这个主要是走索引的原因),但是如果
select * from orders ,那么还是非排序方式展示,但是A选项的"whenever the ORDERS table is queried rows should be displayed in order of increasing ORDER_NUM values" 意思应该是:每次查询 ORDERS表的时候,数据都会以 ORDER_NUM 列值的升序排列展示。这个个人觉得是有问题的,望解疑!
UNIQUE?DB2?orders UNIQUEDB2ordersINDEX
------解决方案--------------------------------------------------------
做题库不一定要迷信答案 但一定要有自己的想法
不论a还是b 你觉得will be对呢 还是should be对呢