Fundamentals
SQL Basics Test
20 multiple choice questions on SQL: filtering, joins, grouping, NULL, indexes, transactions and safe queries.
- Questions
- 20
- Time
- 20 min
- Pass mark
- 60%
No account or email needed.
About this test
This test covers the SQL that backend and full stack developers use every week: selecting and filtering rows, joining tables, grouping and aggregating, how NULL behaves, and the basics of indexes and transactions.
Questions use standard SQL, so the answers apply to PostgreSQL, MySQL and most other databases unless a question says otherwise.
What it covers
The question set has 24 questions: 12 easy, 10 medium and 2 hard. Each attempt draws 20 of them at random, so a second try is not the same test.
- SQL (24)
Try a few sample questions
These are real questions from the set, with the answers and a short explanation. Read the question, decide, then open it to check.
Sample 1 · SQL · easyWhich clause filters individual rows before they are grouped?Show the answer
- HAVING
- WHERECorrect
- GROUP BY
- ORDER BY
WHERE filters rows before grouping. HAVING filters the groups afterwards.
Sample 2 · SQL · easyWhat does SELECT DISTINCT do?Show the answer
- Sorts the results
- Removes duplicate rows from the resultsCorrect
- Selects only the first row
- Joins two tables
DISTINCT returns each different row once.
Sample 3 · SQL · easyWhat does an INNER JOIN return?Show the answer
- All rows from both tables
- Only the rows that have a match in both tablesCorrect
- All rows from the left table
- Only rows without a match
An inner join keeps only the pairs of rows that satisfy the join condition.
How it works
- 20 multiple choice questions, drawn at random from a larger set.
- 20 minutes on the clock. The test submits itself when time runs out.
- Pass mark: 60%.
- No marks are taken off for wrong answers, so answer every question.
- Some questions have more than one correct answer. You must pick all of them to score.
- When you finish you see your score, the correct answers and a short explanation for each.
- Your answers save as you go, so a dropped connection will not lose your work.
- Please stay on the test page. Switching to another tab or window is recorded and you will see a warning.
- Copying text, printing and screenshots are not allowed during the test.
More practice tests
- Git and Web Basics TestFundamentals
- JavaScript Fundamentals TestFundamentals
- Python Basics TestFundamentals
- React Fundamentals TestFundamentals
See all practice tests.
