sql-aggregates Flashcards

1
Q

What are some examples of aggregate functions?

A

max(), sum(), min(), every(), count(), json.agg()

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

What is the purpose of a group by clause?

A

To separate rows into groups and perform aggregate functions on those groups of rows. Partitions the results by the part you don’t want duplicates of.

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

What is the rule for select and group by for aggregate functions

A

Columns from select that are not aggregate functions need to appear in group by unless you can replace that column by a unique id.

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