Menu
CoddyTech

Above the Customer Average

Part of the Connected Data section of Coddy's PostgreSQL journey. Lesson 10 of 25.

challenge icon

Challenge

Medium

Use a CTE to calculate total order amount per customer, then return customer_id and total for customers whose total exceeds the average of those customer totals. Include ordering customers only and order by customer_id.

The input tables are shown in the test panel. Each run starts from fresh data. Return the named columns in the stated order; do not hard-code the displayed rows.

Try it yourself

-- Write your SQL here.

All lessons in Connected Data

Practice on your own: PostgreSQL playground