ADVERTISEMENT
ADVERTISEMENT

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

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.


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.


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.

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.


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.


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.


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.


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;


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.


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.

ADVERTISEMENT
ADVERTISEMENT


Comments and Discussions!



ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.