You've got forty applicants for one data analyst seat, a hiring manager who wants a shortlist by Friday, and a question bank somebody copied from a tutorial site two years ago. Half the candidates will produce a clean-looking query that double-counts revenue the moment an order joins to two invoices. The other half will write something clumsy but correct, and your panel will mark them down for style. That's the main risk with a SQL assessment test: it isn't too easy or too hard, it's measuring the wrong thing.
Design it as a validity problem. Decide what the job asks a person to do with data, build a dataset messy enough to expose bad assumptions, and write the grading rules and access rules before anyone starts a timer. A test built that way tells you who can produce an answer somebody can audit. A syntax quiz tells you who revised last night.
Sample SQL Assessment Test Questions by Level
Start with the question set, then read why each tier exists. The diagnostic proves a candidate can retrieve and filter rows at all. The applied tier proves they can summarise data the way a business asks for it. The reasoning tier proves they notice when a join inflates a number. The optional optimisation task proves they can read what the engine did, which only matters for some roles.
| Level | Skills tested | Sample task | Time |
|---|---|---|---|
| Diagnostic | SELECT, WHERE, ORDER BY, NULL checks | List customers from Pune who placed an order in the last 30 days, latest order first | 10-15 min |
| Applied | GROUP BY, HAVING, inner and left joins | Show monthly revenue per region and list regions with more than 10 orders | 30-45 min |
| Reasoning | Duplicate rows, one-to-many joins, aggregate validation | Count distinct customers per product line when orders join to multiple invoices, and explain why a plain COUNT overstates the total | 15-20 min |
| Optional optimisation | Correlated subqueries, EXPLAIN plans, indexes | Rewrite a correlated subquery as a join and explain how the plan changes | 15 min |
Why the tiers sit in this order
The diagnostic is a gate, not a score. Candidates who can't filter a date window and sort a result set shouldn't reach the applied tier, because your reviewers will spend twenty minutes reading queries that were never going to work. Run it first, auto-mark it, and stop there for anyone who fails it. That single change protects more panel time than any question you could add.
The applied and reasoning tiers carry the hiring signal. SQL is heavily assessed already: it accounted for 8.59% of all technology assessments on the DevSkiller platform in 2024, ranking third among assessed technologies, according to DevSkiller's 2024 Skills Management and Assessment Insights report. Volume isn't the problem. Question quality is.
Ground the levels in what people were actually taught
These tiers aren't arbitrary. An Indian university Database Management Systems syllabus sets out a structured progression through DDL, DML, DCL, primary and foreign keys, uniqueness and validation constraints, aggregate and built-in functions, set operations, subqueries, correlated subqueries, GROUP BY, HAVING, ORDER BY, joins, EXISTS, ANY, ALL and views. When your levels follow that progression, a low score means something specific rather than "bad at coding".
Practical rule: name the dialect in the instructions. Every task above can be written for PostgreSQL, MySQL or SQL Server, but date functions, string handling and NULL sorting differ enough to cost a good candidate ten minutes.
Keep the schema small and believable: customers, orders, order_items, invoices, regions. Five tables give you every join shape you need without turning the test into a schema-reading exercise. If you want more task formats to draw from, our library of coding assessment questions covers adjacent styles.
Your action: pick the three levels that match the role, write one question per level against that five-table dataset, and drop the rest.
Skills to Cover for Each Role
Choose topics before you write a single question. Most bloated SQL tests happen because someone added a window function question because it felt rigorous, then a stored procedure question because a senior engineer liked them.
| Job family | Core SQL topics | Depth to test |
|---|---|---|
| Reporting analyst | Filtering, aggregation, GROUP BY, HAVING | Medium |
| Data analyst | Joins, subqueries, window functions, NULL handling | High |
| Software engineer | DDL, keys, constraints, views, basic transactions | Medium to high |
| Database administrator | Schema design, normalisation, indexing, query tuning, transactions | High |
Where the boundary between roles sits
A reporting analyst asked to design a foreign key structure is being tested on a different job. So is a data analyst asked to write a cursor. The topic list has to come from the work, not from the syllabus you happen to have open.
That said, the academic baseline is useful for calibrating depth. The NIT Tiruchirappalli CS305 course makes SQL fundamentals and query construction explicit learning outcomes, which means query writing is a taught competency you can legitimately screen for in graduate and early-career hiring, not an informal workplace trick.
The three-family cap
Hold one rule: no more than three topic families in a single sitting. A 60-minute test covering aggregation, joins and NULL handling is fair. The same hour covering those plus transactions, indexing and procedural logic measures speed-reading, not skill.
I'd skip stored procedure syntax entirely for roles that never write procedures. You'll filter out capable people who haven't worked in a shop that puts logic in the database, and you'll learn nothing about the work they'll do on Monday.
Mark each topic for your role before you build:
- Must-have for reporting roles: filtering and aggregation, including HAVING against grouped results.
- Must-have for data roles: joins and NULL handling, tested on data where NULLs change the answer.
- Must-have for engineering roles: keys and constraints, because bad schema decisions surface as production bugs.
- Optional everywhere: window functions, unless the role uses them daily.
If you're screening general technical aptitude alongside SQL, keep the two instruments separate rather than blending them, which is the same discipline we apply to a programming aptitude test.
How to Build Your SQL Assessment Test Step by Step
Setting up a role means defining the skills, criteria and interview focus for the next hire, and the test build follows from that definition rather than preceding it. Work through these steps in order. Each one has a usual slip attached, and the slip is what makes the test invalid.
Define the role's three most-used SQL tasks. Write them as sentences a manager would say, such as "produce weekly revenue by region" or "find orders that never invoiced". Then pick the matching levels. The slip: writing questions first and reverse-engineering a role profile afterwards, which produces a test nobody can defend.
Build a schema of four to six tables with real primary and foreign keys, including orders that join to several invoices. That one-to-many shape is where most aggregate errors live. The slip: a tidy star schema where every join is one-to-one, so every wrong query still returns the right number.
Seed the data with duplicate rows, missing values and an empty group. Clean sample data hides exactly the mistakes the test exists to catch. This matters commercially: nearly four in five employers in India reported difficulty finding skilled talent in 2025, according to ManpowerGroup's Talent Shortage 2025 findings, and adding more syntax questions won't fix a judgement gap.
Write each question as a business request with expected output columns. "Show monthly revenue per region, columns: month, region_name, revenue" beats "use GROUP BY with HAVING". The slip: naming the technique in the prompt, which hands the candidate the answer and tests recall instead of translation.
Create a hidden dataset candidates never see, and check every reference answer against it. Without hidden data, a candidate can hard-code the visible result and pass. Run each accepted query against both datasets and compare row counts, not just the first few rows.
Set the time per level and write plain-English instructions with the dialect named. State the engine version, whether the schema diagram is available, and what happens if a query errors. The slip: instructions written in dense technical English that turn a database test into a reading test.
Dry-run it with two colleagues who know the job, and time them. If a strong performer needs twice your budget, the budget is wrong. The slip: piloting only on junior staff, then setting a cut-off that your best people would fail.
Two habits that keep the build honest
Keep every question readable in 90 seconds. If a candidate spends four minutes decoding the prompt, you've measured comprehension speed, not SQL. And never share the answer key with candidates, including after rejection, because keys circulate fast in campus and bootcamp groups.
A candidate who writes a simpler query and states the assumption behind it is usually worth more than one who writes an elegant query and can't say what it counts.
Use domain-relevant mess: payments with reversals, logistics with duplicate scans, e-commerce with cancelled orders. Ask candidates to name one data-quality risk they spotted. That single free-text field separates people who check their output from people who ship the first result that runs.
Scoring Rubric for Correctness, Efficiency and Explanation
Score four criteria separately. One pass/fail number hides the difference between a candidate who is careless and one who is unsafe. The test is a validity problem, not a syntax quiz. Messy data, stated assumptions and auditable answers should count as much as a clever query, and fairness rules should be fixed before the first candidate sits.
| Criterion | Weight | Full marks | Common deduction |
|---|---|---|---|
| Correctness on hidden data | 50% | Result matches on every hidden dataset | Missed duplicates or empty groups |
| Efficiency | 20% | Clean joins, filters that use indexes, no unnecessary scans | Cartesian joins, non-sargable predicates |
| Explanation and assumptions | 20% | Assumptions and data risks stated clearly | No reasoning given for the approach |
| Readability | 10% | Named CTEs or clear aliases, consistent formatting | Single unreadable nested query |
Correctness is a gate, efficiency is a dial
For core business queries, demand 100% logical correctness before any other criterion counts. A staged methodology set out in a Springer chapter on automated SQL evaluation tests schema comprehension first, then progressively harder queries across joins, aggregation, subqueries, window functions and NULL handling, then executes submissions against hidden edge-case data, and scores correctness separately from efficiency using execution plans. That separation matters because a query can return the right answer for the visible sample and still fail on duplicates, NULLs, empty groups or date edges. Automated evaluators can award partial credit and give qualitative feedback on partially correct queries, which single-answer multiple choice cannot do.
Efficiency deductions should be specific and plan-based: unnecessary full scans, Cartesian joins, non-sargable predicates such as wrapping an indexed date column in a function, and failure to use an available index. Give the deduction where the plan shows avoidable work, not where the answer merely looks less elegant. Do not deduct for a query that is slower but correct on a small dataset unless the role involves tuning. If the job is analytical reporting, a readable query with a clear assumption may be worth more than a narrow optimisation that hides the business logic.
Report engines separately, not "SQL"
Record engine-specific competency on the scorecard instead of one blended SQL rating. A candidate may be strong in one dialect and cautious in another, and that distinction matters when the role names an engine. Keep the rating tied to the dialect used in the task and the schema the candidate was given. That gives reviewers a defensible basis for comparing answers instead of treating every SQL query as the same evidence.
Partial credit, worked
Say a candidate joins orders to invoices correctly, groups by region and month, then writes HAVING COUNT(*) > 10 instead of counting distinct orders. The join logic, the grouping and the output shape are right. I would award most of the correctness marks, deduct for the edge case where duplicates inflate the count, and give full explanation marks if the candidate flagged the duplicate risk themselves. That is the practical value of a rubric: it separates a reasoning slip from a failure to inspect data.
For the diagnostic task, write one grader-facing reference answer: a SELECT on customers joined to orders, a WHERE filter on city and a 30-day date window, an ORDER BY on order date descending, plus a note on how NULL customer keys are excluded. Graders check submissions against the hidden dataset, never against the reference text alone, because two different queries can both be right. The reference answer is a control, not a script to match word for word.
Borderline rule: any score within five points of the cut-off goes to a second reviewer, with the reason recorded.
Write the rubric before the first candidate sits and share it with every interviewer. Candidate responses should be reviewed alongside structured insights, with the hiring team making the final decision. A shared framework keeps role criteria at the centre of that process, and a consistent interview scorecard is what stops two reviewers scoring the same query ten points apart.
Fair Rules for Dialect Access and AI Assistance
The assumption most employers make is that a timed browser test measures SQL. It measures SQL plus English reading speed, plus familiarity with one dialect, plus connection quality, plus whether the candidate has sat this style of assessment before. Strip those out or you're ranking candidates on their broadband.
That matters when the pipeline is already thin. In the 2026 NASSCOM–Indeed findings cited in Masai School's guide to switching into data analytics, 58% of employers cite low applicant volume as a hiring challenge and 50% cite skills mismatch. Rejecting capable people for dialect unfamiliarity is an expensive way to widen a gap you already have.
Access rules to set before launch
Write instructions that describe the output, not the syntax, so a MySQL user and a SQL Server user read the same task. Publish the schema as a plain diagram and a text listing, keep the dataset small enough to load on a modest connection, and offer one untimed practice question before the clock starts. Give a time allowance on request without asking candidates to justify it in detail.
Decide the AI rule, then test judgement
State plainly whether AI tools are permitted. If they are, don't just allow them and hope: build tasks that expose whether the candidate can verify what a tool produced.
- Schema interpretation: ask which table grain the question needs, before any query is written.
- Verification: hand over a plausible AI-generated query and ask what it returns on the sample rows, including where it's wrong.
- Debugging: supply a broken join that fans out and ask for the fix plus the row-count evidence.
- Explanation: require two sentences on why the result is trustworthy.
If you ban AI, say so and say why, rather than treating a polished answer as proof of cheating. Two things to avoid: penalising someone for a dialect you never told them to use, and flagging an unexplained correct answer as fraud without a conversation. Ask them to walk through it live first.
The decision you owe your candidates is a written AI rule in the test instructions, published before the first sitting.
Pilot and Track Results
Pilot before any real hire. Ask 15 to 20 current employees across levels to sit the test, then compare their scores with what their managers already know about their SQL work. If your strongest reporting analyst fails the applied tier, the test is wrong, not the analyst.
| Metric | How to calculate | What it tells you |
|---|---|---|
| Completion rate | Candidates who submit / candidates who start | Whether the time limit is realistic |
| Median score | Middle score across all candidates | Whether the test is too easy or too hard |
| Pass rate by level | Passes / attempts, per level | Where candidates stall |
| Borderline review rate | Manual reviews / total scores within five points of cut-off | How often the cut-off causes doubt |
| Median time by level | Median minutes per level | Whether each time budget fits the task |
Check median times against the windows you set for each tier. A stable test looks like this: most strong current performers clear the applied level, and the diagnostic removes very few capable people. When most candidates fail one level, suspect the question or the instructions first.
Report accurately. The India Graduate Skill Index defines skill employability as the number of test-takers scoring above the required benchmark divided by the number attempting that skill, and puts technical-skill employability at 44% overall, according to Jagran Josh's report on the Mercer Mettl findings. Publish your denominator and your benchmark alongside any percentage, and never present a candidate's score as job readiness.
Change one thing at a time: a question, a time limit, or a cut-off. Compare scores against later job performance for a few hires before you treat any threshold as settled. Then write down the pilot date and the named owner of the rubric, because an unowned rubric drifts within two hiring cycles.
Career Central brings role setup, AI interviews and coding assessments into one workflow, so your SQL tasks, structured evaluations and candidate evidence sit together instead of in three spreadsheets. Our AI coding assessment explores a candidate's programming skills through technical tasks, and your team reviews the responses alongside structured insights and makes the final call. If you're rebuilding your SQL screen this quarter, visit Career Central and book a demo to see how the assessment and candidate insights would fit your hiring workflow.