The AVG function
The following query computes the average unit_price of
all rows in the stock table. Figure 1: Query
SELECT AVG (unit_price) FROM stock;
(avg)
$197.14
The following query computes the average unit_price of
just those rows in the stock table that have a manu_code of Figure 3: Query
SHM
. SELECT AVG (unit_price) FROM stock WHERE manu_code = 'SHM';
(avg)
$204.93