Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Given a composite index on (a, b, c), which query can use the index?

  1. A WHERE b = 1
  2. B WHERE c = 1
  3. C WHERE a = 1 AND b = 2
  4. D WHERE b = 1 AND c = 2
Answer

WHERE a = 1 AND b = 2

A composite index can only be used from the leftmost column onwards. Skipping the leading column makes the index unusable for that predicate.

All MySQL MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as