Examine the SQL Statements that creates ORDERS table: For which columns would an index be automatically created when you execute the above SQL statement?

  1. ) SER_NO, PROD_ID_NUMBER

  2. ORDER_ID and ORDER_DATE

  3. SER_NO, Composite index on ORDER_ID and ORDER_DATE

  4. SER_NO, ORDER_ID and ORDER_DATE


Correct Option: C

AI Explanation

To answer this question, we need to understand the concept of indexes in SQL.

Indexes are used to improve the performance of queries by allowing the database to quickly find and retrieve specific rows based on the values in certain columns. When a table is created, indexes can be manually specified by the user, or they can be automatically created by the database management system (DBMS) based on certain criteria.

In the given SQL statement that creates the ORDERS table, the columns specified are:

SER_NO PROD_ID_NUMBER ORDER_ID ORDER_DATE

Out of these columns, an index would be automatically created for the composite index on ORDER_ID and ORDER_DATE.

Option C) SER_NO, Composite index on ORDER_ID and ORDER_DATE - This option is correct because a composite index on ORDER_ID and ORDER_DATE would be automatically created.

Therefore, the correct answer is option C.

Find more quizzes: