Here's my dataset (in CSV form for easy reading):
item_category,year,price
"Bacon",1890,0.12
"Bacon",1891,0.126
"Bacon",1892,0.129
"Bacon",1893,0.142
"Eggs (dozen)",1890,0.208
"Eggs (dozen)",1891,0.221
"Eggs (dozen)",1892,0.221
"Eggs (dozen)",1893,0.224
I'd like to find the sum for the price of bacon and eggs for each year. So, the result I want would be:
item_category,year,price
"Bacon and eggs",1890,0.328
"Bacon and eggs",1891,0.347
"Bacon and eggs",1892,0.35
"Bacon and eggs",1893,0.366
I'm a novice at SQL, and I've been looking into Self-Join methods, but they don't seem to be exactly what I'm looking for -- I've basically run out of ideas for now.
If it helps, I also know how to use the Sequel gem for Ruby.