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 列值的升序排列展示。这个个人觉得是有问题的,望解疑
对于“ACMAIN_CHM”的回复,我实已经按照题目的表做过测试了,可能我在问题中没有描述清楚。实际上,个人认为这两个都是有问题的,只不过两者比较,我更倾向于选择B(随机),因为按照字面意思理解,是对表orders的选择,而没有说对列order_num的选择。“Mr_Bean”提到的这一点我确实没有注意,我确定了一下,will be 是 “将会”,而“should be”是应该会,那么意思就是说A代表一种可能的情况,应该是这样但不一定这样,而B的意思就是“会”这样,是肯定的语气,如果按照这么理解的话,那就确实应该选A了。