Short answer: fresher SQL interviews mostly test five things: filtering with WHERE, combining tables with JOINs, summarising with GROUP BY and HAVING, subqueries, and the basics of window functions. Practise the 15 questions below by writing the query and then explaining it out loud. Interviewers care almost as much about how you think through a query as about the final syntax.

Last updated: 7 October 2026

The 15 questions

Basics

  1. What's the difference between WHERE and HAVING?
  2. What's the difference between DELETE, TRUNCATE and DROP?
  3. What is a primary key? A foreign key?
  4. How do you find duplicate rows in a table?

Joins

  1. Explain INNER, LEFT, RIGHT and FULL OUTER JOIN with an example.
  2. Find customers who have never placed an order.
  3. What's a self-join? Give a use case (for example, employees and their managers).

Aggregation

  1. Find the total sales per region, showing only regions above a threshold.
  2. Find the second-highest salary.
  3. Count orders per customer per month.

Subqueries and window functions

  1. Find employees who earn more than their department's average.
  2. What's the difference between RANK, DENSE_RANK and ROW_NUMBER?
  3. Find the top 3 products by sales in each category.
  4. Calculate a running total of sales by date.

Concepts

  1. What is an index, and when can it slow things down?

How to answer a SQL question in an interview

  1. Restate the question and ask about edge cases: "Should ties both count as second-highest?"
  2. Name the tables and columns you'll use.
  3. Say your approach before writing: "I'll group by department, then compare each salary with the group average."
  4. Write the query, then walk through it with a tiny example.

Mistakes freshers often make

  • Using WHERE on an aggregated value instead of HAVING.
  • Forgetting that a LEFT JOIN plus a WHERE on the right table can turn it into an inner join.
  • Not handling NULLs, for example when COUNT(column) skips them.
  • Writing a correct query but staying silent, so the interviewer can't follow your thinking.

For the full round, see our data analyst interview practice page and the technical interview guide.

Rehearse it in an AI mock interview

The written part you can practise alone. Explaining it out loud is the part you need to rehearse. In a Sanviora AI mock interview you choose your role and round, and an AI interviewer asks you five questions out loud. You answer by speaking, as you would in the real room. Afterwards you get a report with an overall score and marks for Communication, Confidence, Structure, Relevance and Depth. You also get feedback on each answer and a list of next steps. Take another interview for the same role and the report shows how you've improved. Start an interview.

The Data Analyst role's technical round is a good fit.

FAQ

How much SQL do freshers need to know?

For most fresher roles: SELECT, WHERE, JOINs, GROUP BY/HAVING, subqueries and basic window functions. Deeper tuning is rarely expected.

Do interviewers expect perfect SQL syntax?

Small syntax slips are usually forgiven if your logic is clear. Explaining your approach matters more.

How do I find the second-highest salary in SQL?

Common approaches are a subquery with MAX below the top value, or DENSE_RANK() as a window function. Mention how you'd handle ties.

Where should I practise SQL questions?

Any practice database, or your own sample tables. Write each query, then explain it out loud as if to an interviewer.