Which statement is true regarding the following CREATE TABLE command?

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 SQL statement?

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 SQL statement?

A.
It would execute successfully and only ORD_ITM_IDX index would be created.

B.
It would give an error because the USING INDEX clause cannot be used on a composite primary key.

C.
It would execute successfully and two indexes ORD_ITM_IDX and ORD_ITM_ID_PK would be created.

D.
It would give an error because the USING INDEX clause is not permitted in the CREATE TABLE command.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


user

user

ALTER TABLE emp1
ADD CONSTRAINT emp_id_pk PRIMARY KEY (empno)
USING INDEX ( CREATE INDEX emp_id_pk ON emp(empno));

ALTER TABLE emp1 drop constraint emp_id_pk;
drop index emp_id_pk;

ALTER TABLE emp1
ADD CONSTRAINT emp_id_pk PRIMARY KEY (empno)
USING INDEX ( CREATE INDEX emp_id_pk ON emp1(empno));

user

user

Only one index can be on the same column or columns.

create table pik (a number, b number);
CREATE INDEX pik_epk ON pik(a,b);

ALTER TABLE pik
ADD CONSTRAINT pk_PersonID PRIMARY KEY (a,b);

scott

scott

Why this answer is correct