Hands-on task
This task is step 6 of the course “PostgreSQL: from your first database to transactions”
PostgreSQL: GROUP BY and HAVING
In the shop database, compute the total order amount per customer, keep only customers with a total greater than 200, and output name|amount sorted by amount descending into /root/big_spenders.txt.
Reference:psql
What you'll practise:
- aggregation
- group by
- having
- sum
- postgresql