SQL skill check
Practise SQL the way interviews test it: joins, GROUP BY, NULLs, subqueries, window functions, and indexes, with queries where you predict the result rows. Answers use standard SQL and note SQL Server or PostgreSQL differences.
15
Questions
14 min
Timer can't pause
Multiple choice
ANSI SQL (notes for SQL Server and PostgreSQL where they differ)
Choose a level
Question type
Topics
- SELECT and filtering
- Joins
- Aggregation and GROUP BY
- Subqueries and CTEs
- Window functions
- NULL handling
- Indexes
- Transactions
Do
Use scratch paper or a notepad to work things out. Skip a question and come back to it later.
Don't
Run the code or look up answers during the check. Open the check in more than one tab or window.
Easy · Mixed · 15 questions · 14 min
By starting, you agree to the Terms and Privacy Policy.
Practice checks each answer as you go, with an explanation. The exam is checked when you submit; 9 of 15 passes and earns a certificate.
Checking your levels…
Certificates come from the certified exam: pass with 9 of 15 while signed in. View a sample certificate.
Sample SQL questions with answers
These are never used in a check, so seeing their answers here won't give anything away.
Question 1 · Easy · SELECT and filtering
Which clause is evaluated first during the conceptual execution order of an ANSI SQL query?- A.FROM
- B.ORDER BY
- C.
SELECT - D.WHERE
Show answer
A. FROM
In standard SQL execution order, FROM (including JOINs) is evaluated first to determine the working dataset before filtering (WHERE) or projection (SELECT).Question 2 · Easy · Joins
Which type of join returns all rows from the left table and only matching rows from the right table, filling with NULL when no match exists?- A.FULL OUTER JOIN
- B.INNER JOIN
- C.LEFT OUTER JOIN
- D.CROSS JOIN
Show answer
C. LEFT OUTER JOIN
A LEFT OUTER JOIN preserves every row from the left table and fills columns from the right table with NULL whenever the join condition does not find a match.Question 3 · Moderate · NULL handling
Tableemployeescontains 10 rows. In 3 of those rows,bonusis NULL. What will the querySELECT COUNT(*), COUNT(bonus) FROM employees;return?
- A.10 and 7
- B.7 and 7
- C.10 and NULL
- D.10 and 10
Show answer
A. 10 and 7
COUNT(*) counts all rows regardless of NULL values, whereas COUNT(column_name) ignores rows where that column evaluates to NULL.Question 4 · Advanced · Aggregation and GROUP BY
Which of the following queries complies with ANSI SQL standards and avoids grouping errors when aggregating data?- A.SELECT dept_id, salary FROM employees GROUP BY dept_id, AVG(salary);
- B.SELECT dept_id, name, AVG(salary) FROM employees GROUP BY dept_id;
- C.SELECT dept_id, COUNT(*) FROM employees WHERE AVG(salary) > 50000 GROUP BY dept_id;
- D.SELECT dept_id, MAX(salary) FROM employees GROUP BY dept_id HAVING AVG(salary) > 50000;
Show answer
D. SELECT dept_id, MAX(salary) FROM employees GROUP BY dept_id HAVING AVG(salary) > 50000;
HAVING filters groups using aggregate expressions like AVG(salary), and the SELECT list only contains columns present in the GROUP BY clause or valid aggregate expressions.
How scoring and certificates work
- Each check has 15 multiple-choice questions with one correct answer, and one timer for the whole check. A question you leave unanswered scores nothing.
- Practice is free without an account and shows whether each answer is right as you go, with an explanation.
- The certified exam is scored when you submit. 60% passes, which is 9 of 15. Easy unlocks Moderate, and Moderate unlocks Advanced.
- Passing the exam while signed in earns a free certificate, valid for one year, with its own verification page. See a sample certificate.
Free tools for SQL: SQL Formatter, AI Text-to-SQL Generator, SQL IN Generator