RienSQL
TASK #27 · Medium

Spending by product group in 2005

Your brief
Find out how much was spent on each of the product groups in 2005. Print the name of the group and the total costs spent on it. If there was no spending on a particular product group, i.e., goods from that group were not bought in 2005, do not include it in the report.
Expected columnsgood_type_name costsFamily
SQL editor
SQLite
Ctrl / ⌘ + ↵
Result

Write a query and run it to see the results.

Schema
family_membersmember_id, status, member_name, birthday
goodsgood_id, good_name, type
good_typesgood_type_id, good_type_name
paymentspayment_id, family_member, good, amount, unit_price, date