View the Exhibit and examine the structure of ORD and ORD_ITEMS tables.
The ORD_NO column is PRIMARY KEY in the ORD table and the ORD_NO and ITEM_NO columns are
composite PRIMARY KEY in the ORD_ITEMS table.
Which two CREATE INDEX statements are valid? (Choose two.)
A.
CREATE INDEX ord_idx1
ON ord(ord_no);
B.
CREATE INDEX ord_idx2
ON ord_items(ord_no);
C.
CREATE INDEX ord_idx3
ON ord_items(item_no);
D.
CREATE INDEX ord_idx4
ON ord,ord_items(ord_no, ord_date,qty);
Does anybody could explain me why it is not 1) as well?
( I know implicitly creates an Index, but does composite keys do not? )
Hi Oscar,
you cannot create a index in a PK column.
Regards,Abraço
Luis
Even we can able to create explicit index on PK. But I think bcoz of composite key, there wont be any implicit index created on it.
So in the case of composite primary key, there will be no index implicitly created on neither columns?
For Primary Key and unique Key, the index will be created implicitly. For FK, the index will be created implicitly on the parent table. For composite key, there is nothing called as implicit.
A composite (primary) key is a primary key that consists of more than one column. So, for the composite primary key we have implicitly created index on all columns the key contains, one index for all the columns (combination of all primary key columns’ values determines one row in a table). It is possible additionally create an index on one or a subset of those columns (not all of them in one index).
Hi , please explain something about option d.Thanks