Skip to content

Aggregate Functions

JoshuaKennedy edited this page Oct 12, 2014 · 4 revisions

SQL Aggregate Functions

AVG COUNT FIRST LAST MAX MIN SUM

SQL aggregate functions return a single value, calculated from values in a column.

For the examples they will be using the INVENTORY table below.

NAME QUANTITY PRICE ID
Box of Crackers 150 1.25 5841976320
Bottled Water 50 0.75 2704831956
Headphones 75 10.00 3671580924
Cellular Smart Phone 100 500.00 6103495827
Brand New Video Game 500 60.00 NULL
Monster Energy Drink® 25 2.00 8429071365

AVG()

EXAMPLES


COUNT()

EXAMPLES


FIRST()

EXAMPLES


LAST()

EXAMPLES


MAX()

EXAMPLES


MIN()

EXAMPLES


SUM()

EXAMPLES


Clone this wiki locally