Recall & Review
beginner
What is the main purpose of creating an index in a database?
An index helps speed up data retrieval by allowing the database to find rows faster without scanning the entire table.
Click to reveal answer
beginner
When should you avoid creating an index on a database column?
Avoid indexing columns that have many duplicate values or are updated very frequently, as indexes can slow down write operations.
Click to reveal answer
beginner
Why is it recommended to create indexes on columns used in WHERE clauses?
Because indexes on columns used in WHERE clauses help the database quickly filter rows matching the condition, improving query speed.
Click to reveal answer
intermediate
What type of columns are best suited for indexing?
Columns with high selectivity, meaning they have many unique values, are best for indexing because they help narrow down search results effectively.
Click to reveal answer
intermediate
How does a composite index differ from a single-column index?
A composite index includes multiple columns and is useful when queries filter or sort by more than one column together.
Click to reveal answer
Which column is best to index for faster searches?
✗ Incorrect
Columns with many unique values help indexes filter data efficiently.
What is a downside of adding too many indexes?
✗ Incorrect
Indexes slow down insert, update, and delete operations because the index must be updated too.
When is a composite index most useful?
✗ Incorrect
Composite indexes speed up queries filtering or sorting by multiple columns.
Which of these is NOT a good candidate for indexing?
✗ Incorrect
Columns with many NULLs and duplicates do not benefit much from indexing.
How does an index improve query performance?
✗ Incorrect
Indexes help the database find relevant rows quickly without scanning all rows.
Explain the key factors to consider when selecting columns for indexing.
Think about how indexes help searches and how they affect updates.
You got /4 concepts.
Describe the difference between single-column and composite indexes and when to use each.
Consider how queries filter data using one or more columns.
You got /4 concepts.