Preparing for a SQL internship or fresher interview? This free SQL interview questions test gives you 15 random questions on query basics, joins, GROUP BY and HAVING, keys and normalisation, subqueries, and indexes and transactions, and explains every answer. You get a new set of questions every time you take it.
What this SQL interview test covers
Every attempt gives you 15 random questions, balanced across 7 topics, with the questions and answer options shuffled, so no two tests are the same.
| Topic | What it checks | Questions per test |
|---|---|---|
| Query basics | SELECT, WHERE, ORDER BY, LIKE, IN, NULL handling | 3 |
| Joins | Inner, left, full outer, cross and self joins | 3 |
| Aggregation & grouping | COUNT, SUM, AVG, GROUP BY, HAVING | 2 |
| Keys & database design | Primary and foreign keys, constraints, normalisation | 2 |
| Creating & changing data | CREATE, ALTER, INSERT, UPDATE, DELETE, TRUNCATE | 2 |
| Subqueries & set operations | Subqueries, EXISTS, UNION vs UNION ALL | 1 |
| Indexes & transactions | Indexes, ACID, COMMIT and ROLLBACK | 2 |
How to read your score
| Score | What it means |
|---|---|
| 12–15 (80%+) | Interview-ready. Your fundamentals are strong. Practise explaining these answers out loud, then start applying. |
| 8–11 (50–79%) | Almost there. A good base with a few gaps. Review your weakest topics and retake the test with new questions. |
| 0–7 (below 50%) | Build the basics. Focus on fundamentals first, using the explanations in your results, and try again in a week. |
Sample SQL interview questions for freshers (with answers)
Here are five questions of the kind the test asks, with answers and explanations.
1. How do you check whether a column has no value?
- A.
WHERE email = NULL - B.
WHERE email IS NULL - C.
WHERE email == NULL - D.
WHERE email EMPTY
Answer: B. NULL means “unknown”, so = NULL is never true. Use IS NULL or IS NOT NULL.
2. What does a LEFT JOIN return?
- A. Only matching rows from both tables
- B. All rows from the right table only
- C. All rows from the left table, plus matching rows from the right table
- D. Only rows from the left table that have no match
Answer: C. Unmatched left rows still appear, with NULLs in the right table’s columns.
3. How do you find customers who have never placed an order?
SELECT c.name
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
WHERE ________;
- A.
o.id = 0 - B.
c.id IS NULL - C.
o.id IS NULL - D.
o.id IS NOT NULL
Answer: C. After a LEFT JOIN, customers with no orders have NULL in the order columns.
4. Which clause filters groups after aggregation?
- A.
ORDER BY - B.
WHERE - C.
HAVING - D.
FILTER BY
Answer: C. HAVING works on grouped results, for example HAVING COUNT(*) > 5.
5. What does the “A” in ACID stand for?
- A. Accuracy: data is always correct
- B. Availability: the database is always online
- C. Authorisation: users need permission
- D. Atomicity: a transaction completes fully or not at all
Answer: D. ACID is Atomicity, Consistency, Isolation and Durability.
Ready to test yourself?
Take the free SQL interview questions test now: 15 random questions, about 10 minutes, with an explanation for every answer.
How to prepare for a SQL internship interview
- Write queries, don’t just read them: install MySQL or PostgreSQL, create two or three related tables, and practise joins and GROUP BY every day.
- Know the classic questions: second-highest salary, duplicate rows, customers without orders, and the difference between WHERE and HAVING come up often.
- Understand design, not just syntax: be ready to explain keys, normalisation and why a database is structured the way it is.
- Revise related topics with the technical interview questions guide.
- Check your overall readiness with the free IT Internship Readiness Test.
More free interview questions tests
- .NET interview questions test: C#, OOP, LINQ, async and ASP.NET Core
- Java interview questions test: OOP, strings, collections, exceptions and Java 8
- Python interview questions test: lists, dictionaries, functions, OOP and generators
- React interview questions test: JSX, props, state, hooks and rendering
- Angular interview questions test: components, data binding, services, routing and RxJS
- Azure interview questions test: cloud concepts, compute, storage, networking and security
- DevOps interview questions test: Git, Linux, CI/CD, Docker and Kubernetes
See all tests and which ones fit your target role on the free internship tests page.
Frequently asked questions
Is this SQL interview test free?
Yes. The test is completely free, needs no login, and does not ask for any personal details. Your best score is saved only in your own browser.
How many questions are in the SQL test?
Each attempt has 15 random multiple-choice questions, balanced across seven topics. The questions and answer options are shuffled, so every retake gives you a new test.
What level is this SQL test?
It is designed for freshers and internship candidates. It checks the SQL fundamentals interviewers commonly ask about, not advanced or certification-level topics.
Which SQL dialect does the test use?
The questions use standard SQL that works in MySQL, PostgreSQL, SQL Server and Oracle. Where databases differ, such as LIMIT vs TOP, the explanation says so.
Does a high score guarantee an internship?
No. A high score shows strong fundamentals, but interviews also check your projects, problem solving, and communication. Use your result to decide what to study next.
Your next step
Scored well? Learn what happens in each internship interview round, from the online test to the HR interview.
Read the interview guide