SQL assessment test: free practice for job applications
Twelve tasks in 25 minutes, the kind that come up in SQL tests when you apply for a job: filtering, grouping, joining tables, window functions. You write every query yourself, no account needed, and at the end you see which topics are solid.
This is a practice test by LearnThisNext. It is not an official test from an employer, a testing company or a database vendor. It covers the topics that SQL tasks in hiring processes usually build on, and only you see your result.
How the test works
- 12 tasks on the practice database of an office supplies shop with customers, products, employees, orders and order items. The tables are shown above each task.
- 25 minutes. The timer runs at the top of the test.
- Run your query as often as you like and submit it when the result looks right. As in a real test, there are no hints or solutions.
- The result is checked, not the wording. A join or a subquery is equally fine. The server also runs your query on changed data you do not see, so a typed-in result does not count.
- 9 of 12 correct, so 75 percent, counts as a good result. For every topic that is not there yet, you get a link to the matching lesson.
- No account needed. Your result is not saved and not shared.
Every run draws new tasks, so you can take the test again without just recognising answers.
What SQL tests for jobs usually cover
Every company sets its own test. Some send an online test with a time limit, for example on a platform like HackerRank, some a small take-home database with questions, others ask you to write a query live in the interview. The topics are still much the same, because they come from everyday work with data. These are the ones in the twelve tasks:
| Topic | Typical task |
|---|---|
| SELECT and ORDER BY | show certain columns, sort by price or date |
| WHERE with AND and OR | customers in one city, orders in a date range |
| IN and BETWEEN, LIKE, NULL | a price range, a name pattern, missing phone numbers |
| COUNT and SUM, AVG, MIN, MAX | number of customers, average price, largest order |
| GROUP BY and HAVING | revenue per category, only groups above a threshold |
| CASE WHEN | label products "in stock" or "sold out" |
| INNER JOIN and LEFT JOIN | orders with customer names, customers with no orders |
| subqueries and EXISTS | products above the average price, customers with a delivery |
| window functions | a ranking per department with ROW_NUMBER or RANK |
| WITH (CTEs) and duplicates | a report built in steps, customers entered twice |
Which topics you get depends on the role. For operations or support jobs the first rows are often enough. If you are applying for data analyst, finance or business intelligence roles, expect joins, subqueries and window functions as well. This test does not cover changing data with INSERT, UPDATE and DELETE, which often comes up for developer roles.
Warm up with three typical tasks
Before you start the clock, try three tasks at your own pace, with hints and an explanation. They come from the SQL course and are free. The first one groups rows:
Task Purchasing wants to see how wide the product range is. Return one row per category with category and the number of products in that category.
products 12 rows, 5 columns
| product_id | name | category | price | stock |
|---|---|---|---|---|
| 1 | Copy paper, 500 sheets | Paper | 4.99 | 420 |
| 2 | Blue ballpoint pens, 10-pack | Writing | 3.49 | 310 |
| 3 | Lever arch file, gray | Filing | 2.79 | 185 |
| 4 | Comfort office chair | Furniture | 189 | 12 |
| 5 | Standing desk | Furniture | 449 | 5 |
| 6 | Black ink cartridge | Printer supplies | 24.9 | 64 |
| 7 | Yellow sticky notes, 12 pads | Writing | 6.99 | 0 |
| 8 | Mono laser printer L30 | Electronics | 219 | 8 |
| 9 | 27-inch monitor | Electronics | 279 | 15 |
| 10 | Notebook A5, ruled | Paper | 5.49 | 140 |
| 11 | Black toner XL | Printer supplies | 89.9 | 22 |
| 12 | Cross-cut shredder | Electronics | 129 | 0 |
The second is the classic of every SQL test: joining two tables on a key.
Task The orders table only stores a customer_id, but customer service wants to see names. For every order, show order_id and order_date from orders and the customer's name from customers.
orders 18 rows, 5 columns
| order_id | customer_id | order_date | status | employee_id |
|---|---|---|---|---|
| 1001 | 1 | 2026-01-08 | delivered | 3 |
| 1002 | 4 | 2026-01-12 | delivered | 4 |
| 1003 | 3 | 2026-01-20 | delivered | 3 |
| 1004 | 7 | 2026-02-03 | delivered | 4 |
| 1005 | 2 | 2026-02-11 | cancelled | 8 |
| 1006 | 1 | 2026-02-25 | delivered | 3 |
| 1007 | 10 | 2026-03-04 | delivered | 2 |
| 1008 | 5 | 2026-03-17 | delivered | 4 |
| 1009 | 8 | 2026-03-30 | delivered | 3 |
| 1010 | 6 | 2026-04-07 | delivered | 8 |
| 1011 | 12 | 2026-04-22 | delivered | 4 |
| 1012 | 3 | 2026-05-06 | delivered | 3 |
| 1013 | 9 | 2026-05-19 | cancelled | 8 |
| 1014 | 7 | 2026-06-02 | shipped | 4 |
| 1015 | 1 | 2026-06-10 | shipped | 3 |
| 1016 | 11 | 2026-06-12 | open | NULL |
| 1017 | 4 | 2026-06-13 | open | NULL |
| 1018 | 10 | 2026-06-14 | open | NULL |
customers 12 rows, 7 columns
| customer_id | name | city | country | customer_since | segment | phone |
|---|---|---|---|---|---|---|
| 1 | Harbor Fremont Partners | Boston | USA | 2021-03-15 | Business | 617-555-0142 |
| 2 | Emily Carter | Chicago | USA | 2022-07-01 | Consumer | NULL |
| 3 | Riverside County Office | Riverside | USA | 2020-11-20 | Government | 951-555-0110 |
| 4 | Raj Patel | Leeds | UK | 2023-01-09 | Consumer | 0113 496 0123 |
| 5 | Lakeview Hotel Ltd | Manchester | UK | 2022-04-18 | Business | 0161 496 0456 |
| 6 | Olivia Brooks | Austin | USA | 2024-02-27 | Consumer | NULL |
| 7 | Greene & Shaw LLP | London | UK | 2021-09-05 | Business | 020 7946 0321 |
| 8 | Maple Grove High School | Austin | USA | 2023-08-14 | School | 512-555-0187 |
| 9 | Chloe Evans | Boston | USA | 2025-05-30 | Consumer | 617-555-0199 |
| 10 | Northline Printing Co | Toronto | Canada | 2020-06-12 | Business | 416-555-0133 |
| 11 | Daniel Kim | Seattle | USA | 2024-10-03 | Consumer | NULL |
| 12 | Westbrook Dental Clinic | Chicago | USA | 2022-12-01 | Business | 312-555-0164 |
The third numbers rows with a window function. In tests for analyst roles this often shows up as "top 3 per group".
Task For the new catalog, number the products by price, with the most expensive one as number 1. Show name, price and rank_no for every product. Work out the number with ROW_NUMBER().
products 12 rows, 5 columns
| product_id | name | category | price | stock |
|---|---|---|---|---|
| 1 | Copy paper, 500 sheets | Paper | 4.99 | 420 |
| 2 | Blue ballpoint pens, 10-pack | Writing | 3.49 | 310 |
| 3 | Lever arch file, gray | Filing | 2.79 | 185 |
| 4 | Comfort office chair | Furniture | 189 | 12 |
| 5 | Standing desk | Furniture | 449 | 5 |
| 6 | Black ink cartridge | Printer supplies | 24.9 | 64 |
| 7 | Yellow sticky notes, 12 pads | Writing | 6.99 | 0 |
| 8 | Mono laser printer L30 | Electronics | 219 | 8 |
| 9 | 27-inch monitor | Electronics | 279 | 15 |
| 10 | Notebook A5, ruled | Paper | 5.49 | 140 |
| 11 | Black toner XL | Printer supplies | 89.9 | 22 |
| 12 | Cross-cut shredder | Electronics | 129 | 0 |
What employers look for
SQL tests are rarely about obscure commands. Whoever sets the tasks wants to see that your query is still right when the data is not friendly:
- The right number of rows. A join to a table with several matches multiplies rows, and with them your totals. After every join, check that the row count makes sense.
- Handling NULL.
= NULLnever matches anything; you needIS NULL. And COUNT(column) skips empty values while COUNT(*) does not. - Conditions in the right place. WHERE filters rows before grouping, HAVING filters groups after it.
- Sorting when asked, and then reliably. Without ORDER BY the row order is not defined, even if it happens to look right.
- Readability. Short aliases, one clause per line and a CTE instead of three nested subqueries make your query easy to follow.
Which SQL dialect?
The practice database is SQLite. SELECT, WHERE, GROUP BY, joins, subqueries, WITH and window functions look the same as in MySQL, PostgreSQL or SQL Server. The differences are mostly in individual text and date functions and in how you limit rows (LIMIT or TOP). Ask which database the test uses, and read up on the differences under MySQL vs PostgreSQL vs SQL Server.
How to prepare
Take the test once without preparing. The results show which topics are shaky. Work through exactly those lessons until you can solve their exercises without hints, then take a fresh run. Not sure where you stand overall? Start with the shorter skills assessment: in 15 minutes it gives you a level and the lesson to continue with. For the theory questions that come up in interviews, such as keys, indexes or UNION versus UNION ALL, read SQL interview questions.
What next?
In the SQL course you practise each topic lesson by lesson, with exercises on the same database. Level 1 is free. At the end comes the SQL final test. Pass it and you get a LearnThisNext certificate in your name with a verification link for your resume and LinkedIn. It is not a certification by any database vendor.
Frequently asked questions
Is the SQL assessment test free?
Yes. You need no account and can take it as often as you like. Every run has new tasks.
Are these tasks from real hiring tests?
No. We do not know any company's test and do not copy test questions. The tasks are our own, in the style of typical office and analysis work.
Is my result saved?
No. You see it right after the test, then it is gone. Even when you are logged in, the test does not change your learning progress.
How is this different from the skills assessment?
The skills assessment places you on one of four levels in 15 minutes and recommends a lesson. The assessment test checks twelve topics side by side in 25 minutes, like a test in a hiring process, and shows your gaps topic by topic.
Do I need to install anything?
No. The queries run on our server in a practice database. All you need is a browser.
Do I get a certificate?
Not for this practice test. There is a certificate with a verification link for the final test at the end of the SQL course.