Recall & Review
beginner
What is an index in a database?
An index is like a shortcut or a map that helps the database find data quickly without looking at every row.
Click to reveal answer
beginner
How does an index speed up a query?
It reduces the amount of data the database scans by pointing directly to the rows that match the search, like using a book's index to find a topic fast.
Click to reveal answer
beginner
What happens if a table has no index and you search for a value?
The database checks every row one by one, which takes more time, especially if the table is large.
Click to reveal answer
intermediate
What is a common data structure used for indexes in MySQL?
MySQL often uses B-trees for indexes, which keep data sorted and allow fast searching, inserting, and deleting.
Click to reveal answer
intermediate
Can indexes slow down data insertion or updates? Why?
Yes, because the database must update the index every time data changes, which adds extra work.
Click to reveal answer
What does an index in a database help with?
✗ Incorrect
An index helps the database find data faster by avoiding scanning every row.
If a table has no index, how does the database find data?
✗ Incorrect
Without an index, the database must scan every row to find matching data.
Which data structure is commonly used for indexes in MySQL?
✗ Incorrect
MySQL commonly uses B-trees for indexes to keep data sorted and searchable.
What is a downside of having many indexes on a table?
✗ Incorrect
Indexes must be updated on data changes, which slows down insertions and updates.
Why is using an index like using a book's index?
✗ Incorrect
An index helps find data quickly just like a book's index helps find topics without reading all pages.
Explain in simple terms why indexes make database queries faster.
Think about how a book index helps you find a topic quickly.
You got /3 concepts.
Describe one tradeoff of using indexes in a database.
Indexes speed up reading but can slow down writing.
You got /2 concepts.