Code Room
Code reviewMediumcr-g637
Subject Sql index usageLevel Mid–Senior~20 minCommon in Databases & SQL interviewsIndustries Software development

Question

Review this SQL query that powers a daily-signups report over a 40M-row table.

There is a btree index on `users(created_at)` and one on `users(email)`.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewsql
SELECT user_id, emailFROM usersWHERE DATE(created_at) = '2026-06-20'  AND LOWER(email) LIKE '%@acme.com'ORDER BY created_at DESC;
Run or narrate your approach, then ask the coach.