All Questions
Database Indexing easy

You have a composite index on `(Lastname, Firstname)`. Which query can efficiently use this index?

  1. A A query filtering by the second column only: `WHERE Firstname = 'Alice'`
  2. B A query filtering by the leading column only: `WHERE Lastname = 'Smith'`
  3. C A query filtering by an unrelated third column: `WHERE Age > 25`
  4. D A query that combines the second column with an external range filter: `WHERE Firstname = 'Alice' AND Age > 25`

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions