15 SQL Interview Questions (With How to Practice Each)
Common SQL interview questions — JOINs, GROUP BY, NULLs, duplicates, windows — each paired with a free interactive exercise you can run in your browser.
Warm-up (they still ask these)
- Select specific columns — not
SELECT *in production stories. Practice: SELECT columns. - Filter with WHERE — equality, ranges, AND/OR. Practice: WHERE city.
- Sort and take top N — ORDER BY + LIMIT. Practice: top products.
- DISTINCT vs GROUP BY — unique values vs counts. Guides: DISTINCT, GROUP BY.
JOIN questions (the make-or-break section)
- INNER JOIN customers to orders — who bought something? Practice: INNER JOIN.
- INNER vs LEFT JOIN — who disappears? Guide: INNER vs LEFT.
- Customers with no orders — anti-join /
NOT IN/NOT EXISTS. Guide: anti-join. - LEFT JOIN + WHERE trap — why unmatched rows vanish. Guide: WHERE after LEFT JOIN.
- Multi-table join — orders → items → products. Practice: triple join.
Deep dive: SQL JOIN interview questions.
Aggregation & business metrics
- Count rows vs count non-nulls —
COUNT(*)vsCOUNT(col). Guide: COUNT(*). - GROUP BY city / category — one row per group. Practice: GROUP BY city.
- HAVING vs WHERE — filter groups, not rows. Guide: HAVING vs WHERE.
- Find duplicates — GROUP BY + HAVING COUNT > 1. Guide: find duplicates.
Senior / analytics follow-ups
- CASE WHEN buckets — label rows for reporting. Practice: CASE WHEN.
- RANK / ROW_NUMBER — top item per group. Guide: window RANK · Practice: rank by price.
Prep path if you’re starting from scratch: SQL interview prep order.
FAQ
What are the most common SQL interview questions?
INNER vs LEFT JOIN, customers with no orders, GROUP BY + HAVING, finding duplicates, NULL vs IS NULL, and ranking with window functions. Almost every screen hits at least two of these.
How do I practice SQL interview questions online for free?
Use a site with a real editor and a fixed sample database. SQL Practices lets you run the same Northstar Market drills that match these interview patterns — no install.
Try it yourself
The fastest way to lock this in is a short drill on the same Northstar Market tables.
Practice a classic JOIN question