Coding challenges
SQL interview questions
SQL comes up in almost every data analyst and data engineer interview, often as a live task. Each question here comes with a small, realistic database that runs in your browser. Write your query, run it, then check it against hidden tests that look for the edge cases interviewers care about.
Your query runs in SQLite on your own device. Nothing is sent to us.
A new one every day
Today’s challenge
The SQL
Most graduate and junior data interviews include SQL, either as an online test or live with an interviewer watching. The questions test the same handful of skills again and again: joining tables, filtering, grouping and adding up, handling missing values, and using window functions to rank or compare rows.
Want a timed check across SQL, spreadsheets and charts as well? Take the free 20-minute SQL and skills test on Deeplink Toolkit, and read what data analyst technical tests cover on Deeplink Coaching.
- Clean typed property references Cleaning, Data quality, Aggregation, NULLs · data engineer and data analyst
- Duplicate meter readings Aggregation, Deduplication, NULLs, Data quality · data analyst and data engineer
- Early, on time or late Filtering, Aggregation, NULLs · data analyst
- Fix the AI’s no-show report Debugging, Aggregation, Percentages, Filtering · data analyst
- Fix the Ashgrove repairs query Debugging, Joins, NULLs, Dates and times · data analyst and data engineer
- Fix the on-time returns query Debugging, Conditional aggregation, Percentages, NULLs · data analyst
- Members who didn’t come back Anti-joins, Dates and times, NULLs, Subqueries and CTEs · data analyst
- Missed bin hotspots Aggregation, Filtering, Dates and times · data analyst and data engineer
- Parcels with no matching depot Anti-joins, NULLs, Aggregation, Data quality · data analyst and data engineer
- Quiet times for card payments Conditional aggregation, Dates and times, NULLs, Aggregation · data engineer and data analyst
- Routes with no breakdowns Anti-joins, NULLs, Dates and times · data analyst and data engineer
- Seats sold for every performance Joins, NULLs, Aggregation · data analyst and data engineer
- Share of gifts by payment method Percentages, Aggregation, Subqueries and CTEs, Dates and times · data analyst
- Top three customers by spend Joins, Aggregation, Filtering, Sorting and limits · data analyst and data engineer
- Classes taken by the same members Joins, Deduplication, Aggregation, NULLs · data analyst
- Current state from a change feed Deduplication, Window functions, Ranking and ties, Subqueries and CTEs · data engineer
- Data quality checks with reasons Data quality, NULLs, Subqueries and CTEs, Aggregation · data engineer
- Double-booked consulting rooms Joins, Dates and times, NULLs, Data quality · data engineer
- Fix the AI’s café orders query Debugging, Joins, Aggregation, Subqueries and CTEs · data analyst and data engineer
- Fix the depot delivery summary Debugging, Joins, Deduplication, Dates and times · data analyst and data engineer
- Incremental load with a watermark Incremental loads, Filtering, Subqueries and CTEs, Sorting and limits · data engineer
- Insert, update or skip each row Joins, NULLs, Incremental loads · data engineer
- Month-on-month change in journeys Window functions, Dates and times, Percentages, NULLs · data analyst
- New app users day by day Running totals, Window functions, Deduplication, Percentages, NULLs · data analyst and data engineer
- Online requests for every day Subqueries and CTEs, Dates and times, Joins, NULLs, Aggregation · data engineer and data analyst
- Repair spend by financial year Dates and times, Aggregation, Window functions, Percentages, Joins · data analyst
- Rolling 7-day average takings Window functions, Running totals, Dates and times, Aggregation · data analyst
- Row count drops between loads Window functions, Data quality, Percentages · data engineer
- Sign-ups by first-touch channel Window functions, Joins, Ranking and ties, Percentages, NULLs · data analyst
- The four-hour standard Conditional aggregation, Dates and times, Percentages · data analyst
- Time spent in each repair status Window functions, History tables, Dates and times, NULLs, Aggregation · data engineer and data analyst
- Top two sellers in each shop Ranking and ties, Window functions, Aggregation · data analyst
- When each appeal hit its target Running totals, Window functions, Joins, Dates and times · data analyst
- Each member’s longest gym streak Gaps and islands, Window functions, Dates and times, Ranking and ties, Deduplication · data analyst and data engineer
- Median and 90th percentile waits Window functions, Conditional aggregation, NULLs, Dates and times · data analyst
- Month-one retention by cohort Dates and times, Joins, Percentages, Subqueries and CTEs · data analyst
- Price usage from a tariff history History tables, Joins, NULLs, Conditional aggregation, Dates and times · data engineer
- Probable duplicate members Deduplication, Data quality, Window functions, NULLs, Ranking and ties · data engineer
- Reconcile card settlements Joins, NULLs, Data quality, Aggregation · data engineer and data analyst
- Tariff history from snapshots Gaps and islands, Window functions, History tables · data engineer
- The booking funnel Conditional aggregation, Window functions, Percentages, NULLs, Dates and times · data analyst
Want a day-by-day route through them? Follow the two-week SQL interview plan then the advanced SQL interview plan
Interview guides
Read
Explaining your code out loud is half of a technical interview. These guides show how.
Getting ready for a data role? Deeplink Coaching offers data career coaching for graduates applying for data analyst and data engineer jobs.