Why T-SQL Drills exists

Every item is numbered, so you always know how many are left.

The honest version

5 points

1/5
A small set of patterns covers most SQL screening questions.

Joins that keep or drop rows, grouping, NULLs, ranking, and the traps hiding in each one. Learn those and most questions stop being surprises.

2/5
Every result you see was really run.

Each query and each result shown was run on SQL Server against Microsoft's WideWorldImporters sample database. Nothing is guessed, so what you see is what SQL Server returns. The numbers are real: 663 customers, 73,595 orders.

3/5
Every drill has one trap.

A trap is a query that looks right and runs, but gives the wrong answer. Each drill shows the trap, its wrong result, and why. The build checks that the trap really does give a different answer.

4/5
Treat it like a toll booth.

Timed SQL questions are a cheap, standard filter that companies use because they cannot assess everyone in depth. They are narrow and imperfect. Learn the patterns well enough to get through, and do not mistake the result for your worth or your real ability.

5/5
Practice should have no friction.

No sign-up, no paywall, no ads, and you do not need a database. Open it, swipe, try one, keep going.

How the app works

10 steps

1/10
Swipe up for the next drill.

Scroll, swipe up, or press the down arrow (or J). K or the up arrow goes back. The buttons you use most (Show answer, Retry, Done) stay docked at the bottom of the screen on a phone.

2/10
Find your way around.

On a phone, the tab bar at the bottom has Plan, Bank, Topics (or Tiers) and More. On a computer, the sidebar on the left holds the same things, plus search.

3/10
Use the Plan, or the whole Bank.

The green ▶ Plan button opens a fixed plan of every drill in 7 tiers, easiest first. Bank is the same drills in a shuffled order. The plan and protocol page explains how to work through it, one hour a day.

4/10
Search when you know what you want.

On a phone, tap the magnifying glass. On a computer, the search box is in the sidebar (press / to jump to it). Type part of a drill title or topic name and the feed narrows to the matches.

5/10
Read the card before you answer.

Each card says what one row means, which tables are used, and what you need to know first. Say the grain out loud before you write anything.

6/10
Tap "What's the point?" on any card.

A short panel explains what the drill is for and where the skill shows up in real work. It never gives the answer.

7/10
Phone or desktop layout.

On a computer, a tablet, or a phone held sideways, the page uses the whole window with the question and your answer side by side. On a phone held upright it uses the swipe layout. The 📱 | 🖥 button lets you choose one yourself, and the More tab can switch back to automatic.

8/10
Keep notes.

The Notes button on each card opens a box for anything you want to remember. Notes save automatically in this browser. More has a switch to show only the drills that have one.

9/10
Mark each drill.

Done or Retry on a phone (Completed or Attempted on a computer). The plan and the topic list count them. In More, "Only attempted" shows just the ones to redo.

10/10
Check yourself.

Show answer reveals the query, the real result, the walkthrough in the order SQL runs it, the trap, and the takeaway. The answer box is optional; you can think it through or write it on paper. Copy for AI copies the drill, your answer and the checked reference so any AI can grade you.

Want to run them yourself?

You don't have to. If you want to, install SQL Server Developer (free) and restore the WideWorldImporters sample (the Standard backup) from Microsoft's sql-server-samples releases. The drills run as written. A few write drills use a temporary copy of a table, set up for you at the top of the card, so the real data is never changed.

The topics

All questions and queries are original. WideWorldImporters is Microsoft's sample database (MIT license).