Home / Skill tests / SQL

SQL test: 10 questions to check yourself

In plain words: SQL is the language used to ask a database questions, such as “which customers bought more than once this month”. Answer ten questions, press the button, and see which you got right and why.

4,865 open jobs name SQL today, with a median advertised pay of $186K. The questions are the kind that come up in a first interview.

1Which clause keeps only the rows that meet a condition before any grouping happens?
2What does an INNER JOIN between customers and orders return?
3You need the number of orders for each customer. Which query does it?
4What is the result of comparing a value with NULL using = (for example, price = NULL)?
5Which keyword removes duplicate rows from the result?
6What is a primary key?
7What is the difference between UNION and UNION ALL?
8Which query returns the three highest salaries in a table named staff (in most databases)?
9What is an index for?
10In a transaction, what does ROLLBACK do?

Questions about this test

How do I prepare for a SQL interview?
Work through realistic questions, read why each answer is right, then redo the ones you missed. This test has ten, taken from what interviewers commonly ask a beginner or a junior. Then read the postings: the 4,865 open jobs that name SQL show what employers expect on top of it.
Is this SQL test free?
Yes. It needs no account and no email, runs in your browser and sends nothing anywhere.
What does my score mean?
It is a self-check. Eight or more right means the basics are fresh; five to seven means a good base with gaps; under five means more practice first. It is not an official certificate.

More tests: Excel Python JavaScript Linux Docker All tests