Challenge - 5 Problems
Index Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
When to use an index on a database column?
Which situation is the best reason to create an index on a database column?
Attempts:
2 left
💡 Hint
Think about when indexes help speed up data retrieval.
✗ Incorrect
Indexes improve query speed when columns are used to filter or join data. Columns rarely searched or frequently updated may not benefit from indexes.
❓ query_result
intermediate2:00remaining
Effect of index on query execution
Given a table
Employees with an index on DepartmentID, what is the expected output of this query's execution plan?DBMS Theory
EXPLAIN SELECT * FROM Employees WHERE DepartmentID = 5;Attempts:
2 left
💡 Hint
Indexes help speed up searches on indexed columns.
✗ Incorrect
When a column has an index, the database can use it to quickly locate matching rows instead of scanning the whole table.
📋 Factual
advanced2:00remaining
Correct syntax to create a composite index
Which SQL statement correctly creates a composite index on columns
LastName and FirstName in the Customers table?Attempts:
2 left
💡 Hint
Check the order of keywords and parentheses in CREATE INDEX syntax.
✗ Incorrect
The correct syntax places the index name after CREATE INDEX, then ON table name, then the columns in parentheses separated by commas.
❓ optimization
advanced2:00remaining
Choosing the best index for query optimization
You have a query filtering on
City and Age columns. Which index choice will most likely improve performance best?Attempts:
2 left
💡 Hint
Think about how composite indexes help with multiple column filters.
✗ Incorrect
A composite index on both columns helps the database quickly filter rows matching both conditions in one index lookup.
🔍 Analysis
expert3:00remaining
Why does this index not improve query speed?
A table has an index on
Why might the index not be used?
LastName. The query is:SELECT * FROM Users WHERE UPPER(LastName) = 'SMITH';Why might the index not be used?
Attempts:
2 left
💡 Hint
Consider how functions on columns affect index usage.
✗ Incorrect
Applying a function on an indexed column usually disables the use of that index unless a function-based index exists.