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:

TopicTypical task
SELECT and ORDER BYshow certain columns, sort by price or date
WHERE with AND and ORcustomers in one city, orders in a date range
IN and BETWEEN, LIKE, NULLa price range, a name pattern, missing phone numbers
COUNT and SUM, AVG, MIN, MAXnumber of customers, average price, largest order
GROUP BY and HAVINGrevenue per category, only groups above a threshold
CASE WHENlabel products "in stock" or "sold out"
INNER JOIN and LEFT JOINorders with customer names, customers with no orders
subqueries and EXISTSproducts above the average price, customers with a delivery
window functionsa ranking per department with ROW_NUMBER or RANK
WITH (CTEs) and duplicatesa 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_idnamecategorypricestock
1Copy paper, 500 sheetsPaper4.99420
2Blue ballpoint pens, 10-packWriting3.49310
3Lever arch file, grayFiling2.79185
4Comfort office chairFurniture18912
5Standing deskFurniture4495
6Black ink cartridgePrinter supplies24.964
7Yellow sticky notes, 12 padsWriting6.990
8Mono laser printer L30Electronics2198
927-inch monitorElectronics27915
10Notebook A5, ruledPaper5.49140
11Black toner XLPrinter supplies89.922
12Cross-cut shredderElectronics1290

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_idcustomer_idorder_datestatusemployee_id
100112026-01-08delivered3
100242026-01-12delivered4
100332026-01-20delivered3
100472026-02-03delivered4
100522026-02-11cancelled8
100612026-02-25delivered3
1007102026-03-04delivered2
100852026-03-17delivered4
100982026-03-30delivered3
101062026-04-07delivered8
1011122026-04-22delivered4
101232026-05-06delivered3
101392026-05-19cancelled8
101472026-06-02shipped4
101512026-06-10shipped3
1016112026-06-12openNULL
101742026-06-13openNULL
1018102026-06-14openNULL
customers 12 rows, 7 columns
customer_idnamecitycountrycustomer_sincesegmentphone
1Harbor Fremont PartnersBostonUSA2021-03-15Business617-555-0142
2Emily CarterChicagoUSA2022-07-01ConsumerNULL
3Riverside County OfficeRiversideUSA2020-11-20Government951-555-0110
4Raj PatelLeedsUK2023-01-09Consumer0113 496 0123
5Lakeview Hotel LtdManchesterUK2022-04-18Business0161 496 0456
6Olivia BrooksAustinUSA2024-02-27ConsumerNULL
7Greene & Shaw LLPLondonUK2021-09-05Business020 7946 0321
8Maple Grove High SchoolAustinUSA2023-08-14School512-555-0187
9Chloe EvansBostonUSA2025-05-30Consumer617-555-0199
10Northline Printing CoTorontoCanada2020-06-12Business416-555-0133
11Daniel KimSeattleUSA2024-10-03ConsumerNULL
12Westbrook Dental ClinicChicagoUSA2022-12-01Business312-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_idnamecategorypricestock
1Copy paper, 500 sheetsPaper4.99420
2Blue ballpoint pens, 10-packWriting3.49310
3Lever arch file, grayFiling2.79185
4Comfort office chairFurniture18912
5Standing deskFurniture4495
6Black ink cartridgePrinter supplies24.964
7Yellow sticky notes, 12 padsWriting6.990
8Mono laser printer L30Electronics2198
927-inch monitorElectronics27915
10Notebook A5, ruledPaper5.49140
11Black toner XLPrinter supplies89.922
12Cross-cut shredderElectronics1290

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. = NULL never matches anything; you need IS 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.

Found some gaps? Here is how to close them

The SQL course takes you level by level through every topic in the test, each lesson with exercises in your browser. Premium unlocks every exercise and project, plus the final test with certificate.

Go to the SQL course See Premium

Write to us

Choose language

Select your preferred language