Examine the SQL statement that creates ORDERS table: CREATE TABLE orders (SER_NO NUMBER UNIQUE, ORDER_ID NUMBER, ORDER_DATE DATE NOT NULL, STATUS VARCHAR2(10) CHECK (status IN ('CREDIT', 'CASH')), PROD_ID NUMBER REFERENCES PRODUCTS(PRODUCT_ID), ORD_TOTAL NUMBER, PRIMARY KEY (order_id, order_date)); For which columns would an index be automatically created when you execute the above SQL statement?

  1. SER_NO

  2. ORDER_ID

  3. STATUS

  4. PROD_ID

  5. ORD_TOTAL

  6. composite index on ORDER_ID and ORDER_DATE


Correct Option: A,F

AI Explanation

To determine which columns would have an index automatically created when executing the given SQL statement, we need to consider the following:

  1. The "UNIQUE" constraint on the "SER_NO" column would automatically create an index for that column (Option A).

  2. The "PRIMARY KEY" constraint on the combination of "ORDER_ID" and "ORDER_DATE" columns would automatically create a composite index on those columns (Option F).

Therefore, the correct answer is options A and F.

Find more quizzes: