Window Functions interview questions

18 Window Functions questions from the SQL 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 Window function?

Senior
  1. A.SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows
  2. B.divides rows into groups within which a window function operates
  3. C.a function computing across a set of rows related to the current row without collapsing them
  4. D.RANK leaves gaps in numbering after ties; DENSE_RANK does not

Answer + AI explanation with Pro

2. Which term means: "a function computing across a set of rows related to the current row without collapsing them"?

Senior
  1. A.Window function
  2. B.ROW_NUMBER
  3. C.Running total
  4. D.LAG / LEAD

Answer + AI explanation with Pro

3. Which statement is correct?

Senior
  1. A.Window function — divides rows into groups within which a window function operates
  2. B.Window function — SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows
  3. C.Window function — a function computing across a set of rows related to the current row without collapsing them
  4. D.Window function — assigns a unique sequential number to rows within a partition

Answer + AI explanation with Pro

4. What is ROW_NUMBER?

Mid
  1. A.divides rows into groups within which a window function operates
  2. B.assigns a unique sequential number to rows within a partition
  3. C.a function computing across a set of rows related to the current row without collapsing them
  4. D.RANK leaves gaps in numbering after ties; DENSE_RANK does not

Answer + AI explanation with Pro

5. Which term means: "assigns a unique sequential number to rows within a partition"?

Mid
  1. A.LAG / LEAD
  2. B.RANK vs DENSE_RANK
  3. C.ROW_NUMBER
  4. D.PARTITION BY

Answer + AI explanation with Pro

6. Which statement is correct?

Mid
  1. A.ROW_NUMBER — a function computing across a set of rows related to the current row without collapsing them
  2. B.ROW_NUMBER — RANK leaves gaps in numbering after ties; DENSE_RANK does not
  3. C.ROW_NUMBER — SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows
  4. D.ROW_NUMBER — assigns a unique sequential number to rows within a partition

Answer + AI explanation with Pro

7. What is RANK vs DENSE_RANK?

Senior
  1. A.assigns a unique sequential number to rows within a partition
  2. B.divides rows into groups within which a window function operates
  3. C.a function computing across a set of rows related to the current row without collapsing them
  4. D.RANK leaves gaps in numbering after ties; DENSE_RANK does not

Answer + AI explanation with Pro

8. Which term means: "RANK leaves gaps in numbering after ties; DENSE_RANK does not"?

Senior
  1. A.Running total
  2. B.ROW_NUMBER
  3. C.RANK vs DENSE_RANK
  4. D.PARTITION BY

Answer + AI explanation with Pro

9. Which statement is correct?

Senior
  1. A.RANK vs DENSE_RANK — access a value from a previous or following row within the partition
  2. B.RANK vs DENSE_RANK — divides rows into groups within which a window function operates
  3. C.RANK vs DENSE_RANK — RANK leaves gaps in numbering after ties; DENSE_RANK does not
  4. D.RANK vs DENSE_RANK — SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows

Answer + AI explanation with Pro

10. What is PARTITION BY?

Senior
  1. A.access a value from a previous or following row within the partition
  2. B.a function computing across a set of rows related to the current row without collapsing them
  3. C.divides rows into groups within which a window function operates
  4. D.assigns a unique sequential number to rows within a partition

Answer + AI explanation with Pro

11. Which term means: "divides rows into groups within which a window function operates"?

Senior
  1. A.LAG / LEAD
  2. B.PARTITION BY
  3. C.Running total
  4. D.RANK vs DENSE_RANK

Answer + AI explanation with Pro

12. Which statement is correct?

Senior
  1. A.PARTITION BY — a function computing across a set of rows related to the current row without collapsing them
  2. B.PARTITION BY — assigns a unique sequential number to rows within a partition
  3. C.PARTITION BY — RANK leaves gaps in numbering after ties; DENSE_RANK does not
  4. D.PARTITION BY — divides rows into groups within which a window function operates

Answer + AI explanation with Pro

13. What is LAG / LEAD?

Senior
  1. A.a function computing across a set of rows related to the current row without collapsing them
  2. B.access a value from a previous or following row within the partition
  3. C.divides rows into groups within which a window function operates
  4. D.RANK leaves gaps in numbering after ties; DENSE_RANK does not

Answer + AI explanation with Pro

14. Which term means: "access a value from a previous or following row within the partition"?

Senior
  1. A.LAG / LEAD
  2. B.RANK vs DENSE_RANK
  3. C.ROW_NUMBER
  4. D.PARTITION BY

Answer + AI explanation with Pro

15. Which statement is correct?

Senior
  1. A.LAG / LEAD — SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows
  2. B.LAG / LEAD — assigns a unique sequential number to rows within a partition
  3. C.LAG / LEAD — access a value from a previous or following row within the partition
  4. D.LAG / LEAD — divides rows into groups within which a window function operates

Answer + AI explanation with Pro

16. What is Running total?

Senior
  1. A.assigns a unique sequential number to rows within a partition
  2. B.access a value from a previous or following row within the partition
  3. C.a function computing across a set of rows related to the current row without collapsing them
  4. D.SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows

Answer + AI explanation with Pro

17. Which term means: "SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows"?

Senior
  1. A.Running total
  2. B.RANK vs DENSE_RANK
  3. C.PARTITION BY
  4. D.ROW_NUMBER

Answer + AI explanation with Pro

18. Which statement is correct?

Senior
  1. A.Running total — divides rows into groups within which a window function operates
  2. B.Running total — SUM(...) OVER (ORDER BY ...) that accumulates values across ordered rows
  3. C.Running total — access a value from a previous or following row within the partition
  4. D.Running total — assigns a unique sequential number to rows within a partition

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 Window Functions 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