81
SQL Server Interview
Aggregate Functions, GROUP BY & Window Functions
SQL Server interview questions covering aggregate functions, group by & window functions.
20 Questions Filter by level
Interview questions
Open a question for the full answer, code and interview guidance.
82
What is the difference between COUNT(*), COUNT(column), and COUNT(DISTINCT column)?
83
What does SUM() do?
84
What does AVG() do?
85
What do MIN() and MAX() do?
86
What is GROUP BY?
87
Can GROUP BY use multiple columns?
88
What is the HAVING clause?
89
What is the difference between WHERE and HAVING?
90
What is conditional aggregation?
91
What is a window function?
92
What is the OVER clause?
93
What is ROW_NUMBER()?
94
What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK()?
95
How do you find the top N rows per group?
96
What are LAG() and LEAD()?
97
What are FIRST_VALUE() and LAST_VALUE()?
98
How do you calculate a running total?
99
How can ROW_NUMBER() be used to identify duplicate records?
100