SQL interview questions

24 SQL questions from the Data Engineering bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

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)

Answer + AI explanation with Pro

2. Which term means: "a window function giving a unique sequential number with no ties"?

Junior
  1. A.ROW_NUMBER()
  2. B.CTE
  3. C.WHERE vs HAVING
  4. D.LEFT JOIN

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

5. Which term means: "a window function giving ties the same rank but skipping the next rank(s)"?

Junior
  1. A.LEFT JOIN
  2. B.RANK()
  3. C.partition pruning defeat
  4. D.CTE

Answer + AI explanation with Pro

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)

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

8. Which term means: "a window function giving ties the same rank with no gaps"?

Junior
  1. A.RANK()
  2. B.CTE
  3. C.DENSE_RANK()
  4. D.LEFT JOIN

Answer + AI explanation with Pro

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)

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

11. Which term means: "WHERE filters rows before aggregation; HAVING filters groups after"?

Junior
  1. A.LEFT JOIN
  2. B.ROW_NUMBER()
  3. C.partition pruning defeat
  4. D.WHERE vs HAVING

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

14. Which term means: "a clause (Snowflake/BigQuery) filtering on a window function without a subquery"?

Mid
  1. A.LEFT JOIN
  2. B.QUALIFY
  3. C.RANK()
  4. D.partition pruning defeat

Answer + AI explanation with Pro

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)

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

17. Which term means: "a named temporary result set defined with WITH for readability/reuse"?

Mid
  1. A.WHERE vs HAVING
  2. B.RANK()
  3. C.CTE
  4. D.partition pruning defeat

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

20. Which term means: "returns all left rows plus matching right rows (NULLs where none match)"?

Junior
  1. A.DENSE_RANK()
  2. B.CTE
  3. C.RANK()
  4. D.LEFT JOIN

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

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)

Answer + AI explanation with Pro

23. Which term means: "wrapping a partition column in a function, which disables pruning"?

Senior
  1. A.CTE
  2. B.partition pruning defeat
  3. C.ROW_NUMBER()
  4. D.WHERE vs HAVING

Answer + AI explanation with Pro

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

Answer + AI explanation with Pro

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every SQL question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers