SQL Technical Round Questions & Answers
40 questions for the technical round stage — 7 easy, 27 medium, 6 hard.
About the technical round round
The technical round is the core of a SQL interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
Tips for the technical round round
- Say your approach out loud before you start writing.
- After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question.
- Pick one project you can explain end to end, including what you would do differently.
- If you get stuck, explain what you would try next instead of going silent.
What are dirty reads, non-repeatable reads and phantom reads?
Show answer
What is the difference between putting a condition in ON versus WHERE in a LEFT JOIN?
Show answer
How do you get the top 3 rows in different databases?
Show answer
What is the difference between IN and EXISTS?
Show answer
How do SQL dialects differ and how do you write portable SQL?
Show answer
You need to update 50 million rows in production. How do you do it safely?
Show answer
What are referential actions such as ON DELETE CASCADE?
Show answer
What is the difference between an index scan and an index seek?
Show answer
A long report query has eight nested subqueries and nobody can maintain it. How would you refactor it?
Show answer
What are equi joins, non-equi joins and natural joins?
Show answer
Compare this month's and last month's sales per product using a full outer join.
Show answer
Match each employee's salary to a grade using a range table.
Show answer
Produce region subtotals and a grand total in one query.
Show answer
What is the difference between clustered and non-clustered indexes?
Show answer
Calculate a 7-day moving average of daily active users.
Show answer
Write an upsert that inserts a row or updates it if it exists.
Show answer
What is an execution plan?
Show answer
Create an index to speed up searching orders by customer and date.
Show answer
How does LIKE work and what are wildcards?
Show answer
Find customers who have never placed an order.
Show answer
The dashboard queries hit the production database and slow down the app at month end. What do you propose?
Show answer
Get the latest 3 orders for every customer using a lateral join.
Show answer
What are FIRST_VALUE, LAST_VALUE and NTH_VALUE?
Show answer
A business user needs a dashboard on a complex 6-table join that runs slowly. Would you use a view or a materialised view?
Show answer
You need each customer's latest address from a history table. How do you query it?
Show answer
Write a query for monthly revenue for the current year.
Show answer
A query with a correlated subquery in SELECT runs for every row and is slow. How do you improve it?
Show answer
What is a covering index?
Show answer
Calculate month-over-month revenue growth percentage.
Show answer
Calculate a running total of daily sales.
Show answer
What is the difference between SUM with CASE and filtering with WHERE?
Show answer
What is GROUP BY and what is the rule for selected columns?
Show answer
What are transaction isolation levels?
Show answer
Find all customers whose email is missing or empty.
Show answer
Find users who logged in on 3 or more consecutive days.
Show answer
What is the difference between UNION and UNION ALL?
Show answer
Finance asks for the count of customers whose total spend crossed 1 lakh in each city. How do you write it?
Show answer
What is the difference between a CTE, a subquery, a temp table and a view?
Show answer
Find departments where every employee earns above 40000.
Show answer
Frequently asked questions
What happens in the SQL technical round round?
The technical round is the core of a SQL interview: concept questions with follow-ups, a live hands-on task and a deep dive into one of your projects. Interviewers check depth, not just definitions.
How do I clear the technical round round?
Say your approach out loud before you start writing. After a correct answer, expect 'why?' and 'what if?' follow-ups; go one level deeper than the question. Pick one project you can explain end to end, including what you would do differently.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.