COUNT, SUM, and AVG Flashcards

1
Q

What do SELECT COUNT statements do?

A

count the number of rows that appear in a database table

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

What is the basic SELECT COUNT statement format?

A

SELECT COUNT(*) FROM table_name;

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

How is the combination of SELECT COUNT and WHERE used?

A

to count how many rows meet a certain criteria

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

How is the combination of SELECT COUNT and GROUP BY used?

A

to count how many row meet each option in the column

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

What do SUM statements do?

A

add all values in a particular column

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

What is the basic SUM statement format?

A

SELECT SUM(column_name) FROM table_name;

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

What do MAX statements do?

A

find the largest value in a column

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

What is the basic MAX statement format?

A

SELECT MAX(column_name) FROM table_name;

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

What do MIN statements do?

A

find the smallest value in a column

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

What is the basic MIN statement format?

A

SELECT MIN(column_name) FROM table_name;

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

What do AVG statements do?

A

find the average value in a column

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

What is the basic AVG statement format?

A

SELECT AVG(column_name) FROM table_name;

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

What do ROUND statements do?

A

round the values in a column to a certain number of decimal places

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

What is the basic ROUND statement format?

A

ROUND(CONDITION(condition column_name), number_of_decimal_places, FROM table_name;

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