Hands-on task
This task is step 5 of the course “SQL with SQLite”
SQLite: revenue per category (GROUP BY)
The database /root/shop.db has a table sales(id, category, amount). Compute the total revenue for each category and write the result to /root/out.txt in the format category|amount (one category per line).
Reference:sqlite3
What you'll practise:
- sqlite3
- group by
- aggregate functions
- sum
- grouping