In short
Tracy AI Interviewer can run a SQL task inside the same interview and follow up on approach and trade-offs, so you hear how an analyst or engineer reasons, not only whether the query runs.
Use the 15 SQL interview questions below, each with a follow-up and what to listen for.
Every result keeps a recording, a timestamped transcript and a written assessment per question; your data lead decides.
Next step: paste three of these questions into a Tracy interview.
We make Tracy AI Interviewer.
A data lead posts an analyst role and gets 150 applications. Every CV says SQL. The CV cannot tell you who writes a join that double counts revenue and who notices. SQL interview questions have to test that, so ask why a total is too high.
These 15 SQL interview questions are written for data leads and recruiters hiring analysts and data engineers. Each has a follow-up and a note on what a strong answer contains. They suit a first conversation of 20 to 30 minutes; a take-home or pairing round belongs later with your own team.
Tracy AI Interviewer runs that first conversation at volume. She asks each candidate questions in their own field, follows up on what they said and waits for the end of the thought. For the wider process, see technical interviews and AI technical interviews.
Fifteen SQL interview questions, grouped by what they test
Pick one or two from each group. Ask the follow-up only after the first answer. Choose your opening questions for the role and write down what a strong answer contains before the first candidate joins.
Group 1: reading the problem
1. You get a table of orders. What do you ask before writing a query?
- Follow up with
- What would change your query most?
- Listen for
- What one row means, the grain, the time zone, whether deleted or test rows exist.
2. A colleague asks for "active users last month". How do you respond?
- Follow up with
- Who decides the definition?
- Listen for
- Pins down active, month and users. Writes the definition down and gets it agreed.
3. When do you use a subquery, a CTE or a temporary table?
- Follow up with
- When would you avoid a CTE?
- Listen for
- Readability first, then reuse and cost. Knows it depends on the engine.
Group 2: joins and duplicates
4. Orders join to payments, and revenue looks too high. Where do you look first?
- Follow up with
- How would you change the query so each order counts once?
- Listen for
- The join. Counts per key, aggregates before joining, or a distinct on the right grain.
5. When does a LEFT JOIN turn into an INNER JOIN by accident?
- Follow up with
- How would you spot it in a result?
- Listen for
- A filter on the right table in the WHERE clause. Compares row counts before and after.
6. How do you find rows in one table with no match in another?
- Follow up with
- Which approach would you pick on a large table, and why?
- Listen for
- Anti-join, NOT EXISTS, NULL handling. Knows NOT IN with NULLs misleads.
Group 3: aggregation and windows
7. How do you get the latest order for each customer?
- Follow up with
- What if two orders share a timestamp?
- Listen for
- A window function with a tie-break. Says what to do on ties, not only how.
8. What is the difference between WHERE and HAVING?
- Follow up with
- Give me a query where using the wrong one gives a wrong answer.
- Listen for
- Row filter versus group filter, with a real example.
9. Calculate a seven-day moving average. What can go wrong?
- Follow up with
- What if some days have no rows?
- Listen for
- Gaps in dates, partial windows at the start, a calendar table.
Group 4: performance and scale
10. A report query slows down as the table grows. What do you check?
- Follow up with
- What if the plan looks fine?
- Listen for
- Reads the plan, indexes, scans, data skew, then load. Measures before changing.
11. When does an index not help?
- Follow up with
- Which columns would you index for a query you choose?
- Listen for
- Low selectivity, functions on columns, write cost. Picks columns with reasons.
12. How would you move a heavy daily report off the live database?
- Follow up with
- How do you know the copy is correct?
- Listen for
- Replica, summary table, schedule. A reconciliation check.
Group 5: trust in the numbers
13. Tell me about a number you reported that was wrong.
- Follow up with
- What do you check now?
- Listen for
- A real case, how they found it, and a routine they added.
14. How do you test a query before someone relies on it?
- Follow up with
- What would you compare against?
- Listen for
- Row counts, a known total, edge dates, a second method.
15. How do you explain a result to someone who does not know SQL?
- Follow up with
- Show me with the last query you wrote.
- Listen for
- Plain words, a caveat stated, no jargon.
A strong answer names what it would check, and a weak one recites syntax
The gap opens in the second answer. We wrote these pairs to show how it sounds; none is a quote from a real candidate.
Table 6: Weak and strong answers to the same questions, written as examples.
| Weak answer | Strong answer | |
|---|---|---|
| Question 4, the inflated revenue | "I'd use DISTINCT." | "If an order has two payments, its amount counts twice. I'd sum payments per order first, then join, and check the total against the orders table." |
| Question 7, the latest order | "ORDER BY date DESC, LIMIT 1." | "That gives one row total. I'd rank within each customer and add an order id as a tie-break." |
| Question 13, the wrong number | "I've never reported a wrong figure." | "I joined on the wrong key once and overcounted by 8 percent. I now compare every total with a source count before I send it." |
Listen for ownership. A candidate who describes a mistake and the check they added has done the work.
One follow-up chain shows where the real answer starts
This is an illustration with sample data, not a real interview. The candidate is fictional. It shows the shape of what Tracy runs: an opening question from your list, the answer, and a follow-up built on it. It starts from question 4.
Tracy: Orders join to payments, and revenue looks too high. Where do you look first?
Candidate (fictional): At the join. If an order has two payments, its amount counts twice.
Tracy: How would you change the query so each order counts once?
Candidate: I'd sum the payments per order in a subquery, then join that to orders.
Tracy: How would you check the new total is right?
Candidate: Compare it with the total in the orders table and spot-check two orders by hand.
The first answer is the textbook one. The third tells you whether the candidate verifies their own work.

A follow-up on the candidate's own answer shows whether they verify the numbers they report.
Run the SQL interview for every applicant
A live call for every applicant does not survive 150 applications.
- A SQL task inside the interview. A SQL task can sit in the same interview as the spoken questions, with follow-ups on approach and trade-offs. Your team reads the answers and the transcript.
- Your questions or ours. Describe the role and Tracy drafts questions from the job description, which you edit; see the product page.
- Start on click. Each candidate opens a link in a browser, with no account and no calendar, at any hour, and is told on the join screen that the conversation is recorded and transcribed. See the participant experience.
- A result you can check. A recording and a timestamped transcript sit behind every result, with a written assessment per question. See AI interview reports.
- Integrity signals, with the evidence. Tracy captures tab changes, gaze, face detection, delay before answers, fullscreen exits and external screens and shows the evidence to a person. A signal is not proof; see AI interview cheating detection.
It is $1 per credit, one credit per started 20 minutes of an interview that produced a result. The first 3 results are free with no card, and there are no seats. See pricing.

Your data lead can open the recording and transcript behind each assessment before deciding.
Keep three decisions with your team
- Who moves forward. Your data lead reads the report and decides. A person has the last word.
- The calibration. Have one analyst read five transcripts blind. If they disagree with the written assessments, change the questions before inviting the next hundred.
- The hands-on round. A real dataset, a take-home or pairing stays with your team.
For a handful of hires, a call with a senior analyst is simpler; see AI interview vs human interview. The case for Tracy starts when applicants outnumber your team's hours, as in volume hiring. Start small: take one analyst opening, use three of these questions and have your data lead read the first batch of reports before you widen it.
Common questions
What are good SQL interview questions?
What SQL interview questions suit a data analyst?
What SQL interview questions suit a data engineer?
Can Tracy run a SQL task in the interview?
Does Tracy decide who to hire?
Try Tracy on your next role
Tracy interviews every applicant, asks follow-up questions and sends you a ranked shortlist.
Try it free (opens in a new tab) Book a demo (opens in a new tab)
Your first 3 results are free. No card needed.
Sources
- Tracy AI Interviewer home page, retrieved 9 Nov 2026.
- Tracy AI Interviewer pricing, retrieved 9 Nov 2026.
- Tracy AI Interviewer Connect page, retrieved 9 Nov 2026.


