Why test SQL skills before you hire?
SQL sits behind analyst, developer, BI and operations jobs, and almost every applicant lists it. The trouble is that wrong SQL still returns a result. A query with the wrong join or a misplaced filter gives a confident, incorrect number that can end up in a board report. A short test shows who understands what their query actually does.
What this template covers
- Basics:
SELECT,WHERE,ORDER BYandDISTINCT. - Joins: when to use
INNER JOINorLEFT JOINand what each keeps. - Grouping: aggregates with
GROUP BY, andHAVINGversusWHERE. - NULL handling:
IS NULLand howCOUNTtreats missing values. - Debugging: spotting duplicated rows after a one-to-many join, and
UNIONversusUNION ALL.
How to run it well
Twelve questions in 15 minutes works for most roles. The queries are written in standard SQL, so they hold for PostgreSQL, MySQL, SQL Server and most other databases. A pass mark around 65% suits junior analysts; ask 75% or more for data engineers and back-end developers who write SQL daily.
Use shuffled questions and options, and keep the short-answer pattern-matching question so candidates have to recall a keyword rather than pick it from a list. When you read the results, the join and NULL questions say the most. Candidates who get them wrong will produce plausible but incorrect reports.
Who this test is for
Use it for data analysts, BI developers, back-end developers, database administrators at entry level, product analysts and finance or operations staff who pull their own data. It also suits internal training: run it before and after a SQL course to see what people actually learnt. Teams hiring for roles where SQL is only part of the job, such as marketing operations or customer success analysts, can shorten it to the easier questions and still get a reliable signal. For dedicated database roles, keep the full set and add harder material of your own.
Make it yours
Rewrite a few questions around your own table names, such as bookings or invoices, so candidates work with something close to the real job. Add questions on window functions, CTEs or your database's date functions for more senior roles, or ask the AI generator to draft them and review each before use. Keep each query short enough to read on a phone screen, since some candidates will take the test away from a desk.