0
0
SQLquery~5 mins

Covering index concept in SQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a covering index in a database?
A covering index is an index that contains all the columns needed to answer a query, so the database can get the data directly from the index without looking up the main table.
Click to reveal answer
beginner
Why does a covering index improve query performance?
Because it avoids accessing the main table, reducing disk reads and speeding up data retrieval.
Click to reveal answer
intermediate
Which columns should be included in a covering index?
All columns that appear in the SELECT, WHERE, JOIN, or ORDER BY clauses of the query should be included in the covering index.
Click to reveal answer
beginner
True or False: A covering index can sometimes be larger than a regular index.
True. Because it includes more columns to cover the query, it can be bigger in size.
Click to reveal answer
intermediate
How does a covering index differ from a regular index?
A regular index may only include key columns for searching, while a covering index includes all columns needed to satisfy the query without accessing the table.
Click to reveal answer
What is the main benefit of using a covering index?
AIt compresses the data to save disk space.
BIt allows the query to be answered using only the index without accessing the main table.
CIt automatically updates the table schema.
DIt encrypts the data for security.
Which columns should be included in a covering index?
AOnly the primary key columns.
BOnly columns that are rarely used.
COnly columns with numeric data.
DAll columns used in SELECT, WHERE, JOIN, or ORDER BY clauses.
True or False: Using a covering index always reduces the size of the index.
AFalse
BTrue
COnly if the table is small
DOnly if the index is unique
What happens if a query uses a covering index?
AThe database locks the entire table.
BThe database ignores the index and reads the table.
CThe database reads data only from the index.
DThe database rebuilds the index.
Which of these is NOT a reason to create a covering index?
ATo encrypt sensitive data.
BTo reduce the number of disk reads.
CTo include all columns needed by a query.
DTo speed up queries by avoiding table lookups.
Explain what a covering index is and how it helps improve query performance.
Think about how the database can answer queries faster by using only the index.
You got /4 concepts.
    Describe how to decide which columns to include in a covering index for a given query.
    Consider all parts of the query that need data.
    You got /5 concepts.