Database Questions and Answers – Index Definition in SQL

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Index Definition in SQL”.

1. What is the purpose of the index in sql server?
a) To enhance the query performance
b) To provide an index to a record
c) To perform fast searches
d) All of the mentioned
View Answer

Answer: d
Explanation: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes.

2. How many types of indexes are there in sql server?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: b
Explanation: They are clustered index and non clustered index.

3. How non clustered index point to the data?
a) It never points to anything
b) It points to a data row
c) It is used for pointing data rows containing key values
d) None of the mentioned
View Answer

Answer: c
Explanation: Nonclustered indexes have a structure separate from the data rows. A nonclustered index contains the nonclustered index key values and each key value entry has a pointer to the data row that contains the key value.
advertisement
advertisement

4. Which one is true about clustered index?
a) Clustered index is not associated with table
b) Clustered index is built by default on unique key columns
c) Clustered index is not built on unique key columns
d) None of the mentioned
View Answer

Answer: b
Explanation: Nonclustered indexes have a structure separate from the data rows. A nonclustered index contains the nonclustered index key values and each key value entry has a pointer to the data row that contains the key value.

5. What is true about indexes?
a) Indexes enhance the performance even if the table is updated frequently
b) It makes harder for sql server engines to work to work on index which have large keys
c) It doesn’t make harder for sql server engines to work to work on index which have large keys
d) None of the mentioned
View Answer

Answer: b
Explanation: Indexes tend to improve the performance.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Does index take space in the disk?
a) It stores memory as and when required
b) Yes, Indexes are stored on disk
c) Indexes are never stored on disk
d) Indexes take no space
View Answer

Answer: b
Explanation: Indexes take memory slots which are located on the disk.

7. What are composite indexes?
a) Are those which are composed by database for its internal use
b) A composite index is a combination of index on 2 or more columns
c) Composite index can never be created
d) None of the mentioned
View Answer

Answer: b
Explanation: A composite index is an index on two or more columns of a table.
advertisement

8. If an index is _________________ the metadata and statistics continue to exists
a) Disabling
b) Dropping
c) Altering
d) Both Disabling and Dropping
View Answer

Answer: a
Explanation: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes.

9. In _______________ index instead of storing all the columns for a record together, each column is stored separately with all other rows in an index.
a) Clustered
b) Column store
c) Non clustered
d) Row store
View Answer

Answer: b
Explanation: A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes.
advertisement

10. A _________________ index is the one which satisfies all the columns requested in the query without performing further lookup into the clustered index.
a) Clustered
b) Non Clustered
c) Covering
d) B-Tree
View Answer

Answer: c
Explanation: A covered query is a query where all the columns in the query’s result set are pulled from non-clustered indexes.

Sanfoundry Global Education & Learning Series – Database Management System.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.