Subjects Questions Quizzes Pricing
Intermediate Open Pro

Leftmost Prefix Rule

A table events has a composite index on (user_id, event_type, created_at).

Which of the following queries will use this index? For those that do, describe what part of the index is used.

A. WHERE user_id = 5 B. WHERE event_type = 'click' C. WHERE user_id = 5 AND event_type = 'click' D. WHERE user_id = 5 AND created_at > '2026-01-01' E. WHERE user_id = 5 AND event_type = 'click' AND created_at > '2026-01-01'

← Back to Database Indexing practice