All fields

“Aggregate Functions & GROUP BY” in Information Technology

23 questions across 1 technology.

Information Technology

23 questions in 1 technology

#QuestionTechnologyTopicLevel
1How does the GROUP BY clause work together with aggregate functions? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYBeginner
2How do the ROLLUP and CUBE extensions to GROUP BY help you generate subtotal and grand total rows in a single query? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYAdvanced
3How would you calculate a running total or a percentage of total using aggregate functions combined with window functions? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYAdvanced
4What are aggregate functions in SQL Server, and what are the most common ones? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYBeginner
5How do you filter the results of a grouped query based on an aggregated value, such as only showing customers who spent more than a certain amount? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYIntermediate
6How do you correctly combine WHERE and HAVING in the same query to filter both individual rows and grouped results? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYIntermediate
7What is the difference between COUNT(*), COUNT(1), and COUNT(column_name) in SQL Server? SQL Server › Aggregate Functions & GROUP BYSQL ServerAggregate Functions & GROUP BYIntermediate
8What is a window function in SQL Server, and how is it different from a regular aggregate function used with GROUP BY? SQL Server › Window FunctionsSQL ServerWindow FunctionsBeginner
9How does the PARTITION BY clause within a window function differ from GROUP BY, and why is this distinction useful? SQL Server › Window FunctionsSQL ServerWindow FunctionsIntermediate
10How do LAG and LEAD window functions let you access values from a previous or following row without needing a self join? SQL Server › Window FunctionsSQL ServerWindow FunctionsIntermediate
11How would you use window functions together to build a comprehensive sales analytics report showing running totals, rankings, and period over period comparisons all in a single query? SQL Server › Window FunctionsSQL ServerWindow FunctionsAdvanced
12What is the difference between RANK, DENSE_RANK, and ROW_NUMBER when there are tied values in the ordering column? SQL Server › Window FunctionsSQL ServerWindow FunctionsIntermediate
13How do you use a subquery within the SELECT list to calculate a related aggregate value alongside each row of the outer query? SQL Server › SubqueriesSQL ServerSubqueriesIntermediate
14How would you build a cross tabulation report using PIVOT that shows multiple aggregate calculations, such as both total and average, for each category? SQL Server › Pivoting & Unpivoting DataSQL ServerPivoting & Unpivoting DataAdvanced
15What is the difference between a LEFT JOIN and a RIGHT JOIN? SQL Server › JoinsSQL ServerJoinsBeginner
16What does it mean to pivot data in SQL Server, and what kind of reporting need does it typically address? SQL Server › Pivoting & Unpivoting DataSQL ServerPivoting & Unpivoting DataBeginner
17How do you find rows that exist in one table but have no matching row in another table using a join? SQL Server › JoinsSQL ServerJoinsIntermediate
18What common mistakes do developers make when writing multi table joins that can lead to unexpectedly large or incorrect result sets? SQL Server › JoinsSQL ServerJoinsIntermediate
19How does the syntax of the PIVOT operator work, and what are its main components? SQL Server › Pivoting & Unpivoting DataSQL ServerPivoting & Unpivoting DataIntermediate
20How would you handle a pivoting scenario where the set of columns needed is not known ahead of time and could change over time? SQL Server › Pivoting & Unpivoting DataSQL ServerPivoting & Unpivoting DataIntermediate
21What are some practical, real world use cases where PIVOT and UNPIVOT are commonly applied in business reporting? SQL Server › Pivoting & Unpivoting DataSQL ServerPivoting & Unpivoting DataIntermediate
22How do CASE expressions work in T-SQL, and how can they be used to implement conditional logic directly within a SELECT statement? SQL Server › T-SQL Fundamentals & SyntaxSQL ServerT-SQL Fundamentals & SyntaxAdvanced
23How would you design a layered set of views to progressively simplify a complex data model for different types of users, such as analysts versus casual business users? SQL Server › ViewsSQL ServerViewsAdvanced