Recall & Review
beginner
What does the COUNT function do in SQL?
COUNT returns the number of rows that match a specified condition or the total number of rows in a table if no condition is given.
Click to reveal answer
beginner
Explain the purpose of the SUM function.
SUM adds up all the values in a numeric column and returns the total sum.
Click to reveal answer
beginner
What does AVG calculate in a dataset?
AVG calculates the average (mean) value of a numeric column by adding all values and dividing by the number of values.
Click to reveal answer
beginner
How do MAX and MIN functions work?
MAX returns the highest value in a column, while MIN returns the lowest value.
Click to reveal answer
intermediate
Can aggregate functions be used with conditions? Give an example.
Yes, aggregate functions can be combined with WHERE clauses to filter data before aggregation. For example, SELECT COUNT(*) FROM users WHERE age > 30 counts rows where age is greater than 30.
Click to reveal answer
Which aggregate function would you use to find the total sales amount?
✗ Incorrect
SUM adds all numeric values, so it is used to find total sales.
What does the COUNT function return when used as COUNT(*)?
✗ Incorrect
COUNT(*) counts all rows in the table.
If you want to find the lowest price in a product list, which function do you use?
✗ Incorrect
MIN returns the smallest value in a column.
Which aggregate function calculates the average value?
✗ Incorrect
AVG calculates the mean of numeric values.
Can aggregate functions be used without grouping data?
✗ Incorrect
Aggregate functions can be used on the whole table or with WHERE filters without GROUP BY.
Describe what each aggregate function COUNT, SUM, AVG, MAX, and MIN does in simple terms.
Think about what you want to find: number, total, average, highest, or lowest.
You got /5 concepts.
Explain how you can use aggregate functions with conditions to get specific results.
Filtering data before aggregation helps get targeted answers.
You got /3 concepts.