W3. SQL Aggregate Functions Flashcards

1
Q

Q: What is an SQL Aggregate function?

A

A: A function that performs a calculation on a set of values and returns a single result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q: In SQL, with which clause are aggregate functions commonly used?

A

A: The GROUP BY clause.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q: What does the GROUP BY clause do in SQL?

A

A: It splits the result set into groups, allowing aggregate functions to return a single value for each group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q: Name some commonly used SQL aggregate functions.

A

MIN() - smallest value
MAX() - largest value
COUNT() - number of rows
SUM() - total sum of a column
AVG() - average of a column

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q: What does the MIN() function do?

A

A: Returns the smallest value in a selected column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q: What does the MAX() function do?

A

A: Returns the largest value in a selected column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q: What does the COUNT() function do?

A

A: Returns the number of rows in a set, including NULL values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q: What does the SUM() function do?

A

A: Returns the total sum of a numerical column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q: What does the AVG() function do?

A

A: Returns the average value of a numerical column.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q: Do aggregate functions ignore NULL values?

A

A: Yes, except for COUNT().

How well did you know this?
1
Not at all
2
3
4
5
Perfectly