SQL interview questions

24 real SQL questions from the Data Engineering bank, as asked in Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd — free to start.

1. What is ROW_NUMBER()?

Junior
  1. A.a window function giving a unique sequential number with no ties
  2. B.returns all left rows plus matching right rows (NULLs where none match)
  3. C.a clause (Snowflake/BigQuery) filtering on a window function without a subquery
  4. D.a window function giving ties the same rank but skipping the next rank(s)
Reveal the answer + AI explanation — free account

3. Which statement is correct?

Junior
  1. A.ROW_NUMBER() — a window function giving a unique sequential number with no ties
  2. B.ROW_NUMBER() — a window function giving ties the same rank with no gaps
  3. C.ROW_NUMBER() — a clause (Snowflake/BigQuery) filtering on a window function without a subquery
  4. D.ROW_NUMBER() — WHERE filters rows before aggregation; HAVING filters groups after
Reveal the answer + AI explanation — free account

4. What is RANK()?

Junior
  1. A.a named temporary result set defined with WITH for readability/reuse
  2. B.wrapping a partition column in a function, which disables pruning
  3. C.a window function giving ties the same rank but skipping the next rank(s)
  4. D.WHERE filters rows before aggregation; HAVING filters groups after
Reveal the answer + AI explanation — free account

6. Which statement is correct?

Junior
  1. A.RANK() — a window function giving a unique sequential number with no ties
  2. B.RANK() — a window function giving ties the same rank with no gaps
  3. C.RANK() — a named temporary result set defined with WITH for readability/reuse
  4. D.RANK() — a window function giving ties the same rank but skipping the next rank(s)
Reveal the answer + AI explanation — free account

7. What is DENSE_RANK()?

Junior
  1. A.returns all left rows plus matching right rows (NULLs where none match)
  2. B.a clause (Snowflake/BigQuery) filtering on a window function without a subquery
  3. C.WHERE filters rows before aggregation; HAVING filters groups after
  4. D.a window function giving ties the same rank with no gaps
Reveal the answer + AI explanation — free account

9. Which statement is correct?

Junior
  1. A.DENSE_RANK() — a window function giving a unique sequential number with no ties
  2. B.DENSE_RANK() — a window function giving ties the same rank with no gaps
  3. C.DENSE_RANK() — a window function giving ties the same rank but skipping the next rank(s)
  4. D.DENSE_RANK() — returns all left rows plus matching right rows (NULLs where none match)
Reveal the answer + AI explanation — free account

10. What is WHERE vs HAVING?

Junior
  1. A.wrapping a partition column in a function, which disables pruning
  2. B.WHERE filters rows before aggregation; HAVING filters groups after
  3. C.a window function giving ties the same rank but skipping the next rank(s)
  4. D.a window function giving a unique sequential number with no ties
Reveal the answer + AI explanation — free account

12. Which statement is correct?

Junior
  1. A.WHERE vs HAVING — WHERE filters rows before aggregation; HAVING filters groups after
  2. B.WHERE vs HAVING — a clause (Snowflake/BigQuery) filtering on a window function without a subquery
  3. C.WHERE vs HAVING — a named temporary result set defined with WITH for readability/reuse
  4. D.WHERE vs HAVING — a window function giving ties the same rank with no gaps
Reveal the answer + AI explanation — free account

13. What is QUALIFY?

Mid
  1. A.returns all left rows plus matching right rows (NULLs where none match)
  2. B.a named temporary result set defined with WITH for readability/reuse
  3. C.a window function giving ties the same rank but skipping the next rank(s)
  4. D.a clause (Snowflake/BigQuery) filtering on a window function without a subquery
Reveal the answer + AI explanation — free account

15. Which statement is correct?

Mid
  1. A.QUALIFY — a window function giving ties the same rank with no gaps
  2. B.QUALIFY — a clause (Snowflake/BigQuery) filtering on a window function without a subquery
  3. C.QUALIFY — WHERE filters rows before aggregation; HAVING filters groups after
  4. D.QUALIFY — returns all left rows plus matching right rows (NULLs where none match)
Reveal the answer + AI explanation — free account

16. What is CTE?

Mid
  1. A.WHERE filters rows before aggregation; HAVING filters groups after
  2. B.wrapping a partition column in a function, which disables pruning
  3. C.a window function giving a unique sequential number with no ties
  4. D.a named temporary result set defined with WITH for readability/reuse
Reveal the answer + AI explanation — free account

18. Which statement is correct?

Mid
  1. A.CTE — WHERE filters rows before aggregation; HAVING filters groups after
  2. B.CTE — a named temporary result set defined with WITH for readability/reuse
  3. C.CTE — a window function giving ties the same rank but skipping the next rank(s)
  4. D.CTE — wrapping a partition column in a function, which disables pruning
Reveal the answer + AI explanation — free account

19. What is LEFT JOIN?

Junior
  1. A.returns all left rows plus matching right rows (NULLs where none match)
  2. B.a window function giving ties the same rank with no gaps
  3. C.WHERE filters rows before aggregation; HAVING filters groups after
  4. D.a clause (Snowflake/BigQuery) filtering on a window function without a subquery
Reveal the answer + AI explanation — free account

21. Which statement is correct?

Junior
  1. A.LEFT JOIN — a named temporary result set defined with WITH for readability/reuse
  2. B.LEFT JOIN — a window function giving a unique sequential number with no ties
  3. C.LEFT JOIN — returns all left rows plus matching right rows (NULLs where none match)
  4. D.LEFT JOIN — WHERE filters rows before aggregation; HAVING filters groups after
Reveal the answer + AI explanation — free account

22. What is partition pruning defeat?

Senior
  1. A.WHERE filters rows before aggregation; HAVING filters groups after
  2. B.wrapping a partition column in a function, which disables pruning
  3. C.a named temporary result set defined with WITH for readability/reuse
  4. D.returns all left rows plus matching right rows (NULLs where none match)
Reveal the answer + AI explanation — free account

24. Which statement is correct?

Senior
  1. A.partition pruning defeat — wrapping a partition column in a function, which disables pruning
  2. B.partition pruning defeat — a window function giving ties the same rank with no gaps
  3. C.partition pruning defeat — a window function giving a unique sequential number with no ties
  4. D.partition pruning defeat — a named temporary result set defined with WITH for readability/reuse
Reveal the answer + AI explanation — free account

Free to start

Answers, AI explanations, and a scored voice mock interview

Sign up free to check your answers with explanations, ask the AI tutor anything on any question, and take one full AI mock interview — scored like a real panel.

Practice SQL free