Which two CREATE INDEX statements are valid?

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);

Discussion

6 Responses to “Which two CREATE INDEX statements are valid?”

  1. Oscar Copado says:

    Does anybody could explain me why it is not 1) as well?

    ( I know implicitly creates an Index, but does composite keys do not? )

  2. user says:

    So in the case of composite primary key, there will be no index implicitly created on neither columns?

  3. Surendar says:

    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.

  4. Dragana says:

    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).

Leave a Reply