-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutility.sql
More file actions
16 lines (13 loc) · 990 Bytes
/
utility.sql
File metadata and controls
16 lines (13 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SELECT DISTINCT year, item_name, area_name, AVG(value) AS price
FROM public.foodprices
WHERE area_name = 'U.S. city average'
AND year BETWEEN '2011' AND '2022'
AND item_name in ('Automotive diesel fuel, per gallon/3.785 liters',
'Electricity per KWH',
'Gasoline, unleaded midgrade, per gallon/3.785 liters',
'Gasoline, unleaded premium, per gallon/3.785 liters',
'Gasoline, unleaded regular, per gallon/3.785 liters',
'Utility (piped) gas per therm'
)
GROUP BY year,item_name, area_name
ORDER BY item_name ASC