Oracle
1Z0-047 · Question #17
Evaluate the following CREATE TABLE command: CREATE TABLE order_item (order_id NUMBER(3), item_id NUMBER(2), qty NUMBER(4), CONSTRAINT ord_itm_id_pk PRIMARY KEY (order_id,item_id) USING INDEX…
The correct answer is A. It would execute successfully and only ORD_ITM_IDX index would be created. See the full explanation below for the reasoning.
Question
Evaluate the following CREATE TABLE command:
CREATE TABLE order_item (order_id NUMBER(3), item_id NUMBER(2), qty NUMBER(4), CONSTRAINT ord_itm_id_pk PRIMARY KEY (order_id,item_id) USING INDEX (CREATE INDEX ord_itm_idx ON order_item(order_id,item_id))); Which statement is true regarding the above SOL statement?
Options
- AIt would execute successfully and only ORD_ITM_IDX index would be created.
- BIt would give an error because the USING INDEX clause cannot be used on a composite primary key.
- CIt would execute successfully and two indexes ORD_ITM_IDX and ORD_ITM_ID_PK would be created.
- DIt would give an error because the USING INDEX clause is not permitted in the CREATE TABLE command.
How the community answered
(18 responses)- A78% (14)
- B6% (1)
- C6% (1)
- D11% (2)
Community Discussion
No community discussion yet for this question.