MCQ | SQL – Index

SQL Index MCQ: This section contains the Multiple-Choice Questions & Answers on SQL Index.
Submitted by Anushree Goswami, on October 18, 2021

SQL Indexes MCQs

1. SQL Indexes slows the execution time of which statement(s)?

  1. UPDATE
  2. INSERT
  3. SELECT
  4. Both A and B

Answer: D) Both A and B

Explanation:

SQL Indexes slows the execution time of UPDATE and INSERT statements.

Discuss this Question


2. SQL indexes speed up the execution time of which statement(s)?

  1. SELECT
  2. WHERE
  3. Both A and B
  4. None of the above

Answer: C) Both A and B

Explanation:

SQL Indexes speed up the execution time of SELECT and WHERE statements.

Discuss this Question


3. Why index is important in SQL?

  1. The large database can be searched quickly with SQL Indexes.
  2. The concept below is a quick way to include different values in those columns.
  3. A smaller table may not recognize the performance of an index when used with an index.
  4. All of the above

Answer: D) All of the above

Explanation:

The index is important in SQL because –

  1. The large database can be searched quickly with SQL Indexes.
  2. The concept below is a quick way to include different values in those columns.
  3. A smaller table may not recognize the performance of an index when used with an index.
  4. Columns (fields) in this data structure are sorted either ascendingly or descendingly according to their data values. For each value, an entry is assigned.
  5. There are only two columns in each index table. Row_id is the first column, and indexed-column is the second.

Discuss this Question


4. In order to create the Index, we need to use which command?

  1. ALTER
  2. UPDATE
  3. CREATE
  4. ADD

Answer: C) CREATE

Explanation:

In order to create the Index, we need to use the CREATE command.

Discuss this Question


5. Unique Index is similar to –

  1. Primary Key
  2. Foreign Key
  3. Composite Key
  4. Alternate Key

Answer: A) Primary Key

Explanation:

Unique Index is similar to Primary Key in SQL.

Discuss this Question


6. To rename the Index, we need to use which command?

  1. RENAME
  2. ALTER
  3. UPDATE
  4. ADD

Answer: B) ALTER

Explanation:

To rename the Index, we need to use ALTER command.

Discuss this Question


7. In order to remove an index, we need to use which command?

  1. REMOVE
  2. DELETE
  3. DROP
  4. DEL

Answer: C) DROP

Explanation:

In order to remove an index, we need to use DROP command.

Discuss this Question


8. Which statement is correct to remove an Index from MySQL Database?

  1. DROP INDEX Index_Name;
  2. ALTER TABLE Table_Name DROP INDEX Index_Name;
  3. DROP INDEX Index_Name ON Table_Name;
  4. DROP INDEX Table_Name.Index_Name;

Answer: B) ALTER TABLE Table_Name DROP INDEX Index_Name;

Explanation:

Correct statement to remove an Index from MySQL Database is - ALTER TABLE Table_Name DROP INDEX Index_Name;

Discuss this Question


9. In the relational database, in order to modify index, we need to use which command?

  1. ALTER
  2. MODIFY
  3. UPDATE
  4. ADD

Answer: A) ALTER

Explanation:

In the relational database, in order to modify index, we need to use ALTER command.

Discuss this Question


10. Which of the following states the correct situation in which Indexes should not be used in SQL?

  1. When the table is small, it is possible to avoid using SQL indexes.
  2. Updates need to be made frequently to the table.
  3. When there are a lot of NULL values in a column, indexed should not be used.
  4. All of the above

Answer: D) All of the above

Explanation:

In the case of following situation, Indexes should not be used in SQL –

  1. When the table is small, it is possible to avoid using SQL indexes.
  2. Updates need to be made frequently to the table.
  3. When there are a lot of NULL values in a column, indexed should not be used.

Discuss this Question






Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.