Window Functions interview questions

18 real Window Functions questions from the SQL 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 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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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
Reveal the answer + AI explanation — free account

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