Recall & Review
beginner
What does the COUNT() function do in SQL?
COUNT() returns the number of rows that match a specified condition or all rows if no condition is given.
Click to reveal answer
beginner
How does the SUM() function work in SQL?
SUM() adds up all the values in a numeric column and returns the total sum.
Click to reveal answer
beginner
What is the purpose of the AVG() function?
AVG() calculates the average (mean) value of a numeric column by adding all values and dividing by the count.
Click to reveal answer
beginner
Explain what MIN() and MAX() functions do.
MIN() returns the smallest value in a column, and MAX() returns the largest value in a column.
Click to reveal answer
intermediate
Can aggregate functions like COUNT(), SUM(), AVG(), MIN(), MAX() be used without GROUP BY?
Yes, they can be used without GROUP BY to calculate values over the entire table or filtered rows.
Click to reveal answer
Which SQL function counts the number of rows in a table?
✗ Incorrect
COUNT() counts rows, while SUM(), AVG(), and MAX() perform calculations on column values.
What does SUM(salary) return in a table of employees?
✗ Incorrect
SUM() adds all salary values to give the total sum.
Which function would you use to find the smallest value in a column?
✗ Incorrect
MIN() returns the smallest value in a column.
If you want the average price of products, which function is correct?
✗ Incorrect
AVG() calculates the average value of the price column.
Can you use aggregate functions without GROUP BY to get a single summary value?
✗ Incorrect
Aggregate functions can be used without GROUP BY to summarize the entire table.
Describe how COUNT(), SUM(), AVG(), MIN(), and MAX() functions work in SQL.
Think about what each function returns when applied to a column.
You got /5 concepts.
Explain when you would use aggregate functions with and without GROUP BY.
Consider how grouping changes the output of aggregate functions.
You got /3 concepts.