-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfruit.sql
More file actions
21 lines (19 loc) · 1.33 KB
/
fruit.sql
File metadata and controls
21 lines (19 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
SELECT 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 ('Bananas, per lb. (453.6 gm)',
'Broccoli, per lb. (453.6 gm)',
'Grapes, Thompson Seedless, per lb. (453.6 gm)',
'Lemons, per lb. (453.6 gm)',
'Lettuce, romaine, per lb. (453.6 gm)',
'Oranges, Navel, per lb. (453.6 gm)'
'Peaches, per lb. (453.6 gm)'
'Pears, Anjou, per lb.(453.6 gm)',
'Peppers, sweet, per lb. (453.6 gm)',
'Potatoes, white, per lb. (453.6 gm)',
'Strawberries, dry pint, per 12 oz. (340.2 gm)',
'Tomatoes, field grown, per lb. (453.6 gm)'
)
GROUP BY year,item_name, area_name
ORDER BY item_name ASC