Your question is SQL Top Customers Query. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Impact Analytics wants to identify its highest-value customers from sales transactions. The result will support prioritization in customer performance reporting.
Write a PostgreSQL query to find the top 5 customers by total sales.
sale_amount.| Column | Type | Description |
|---|---|---|
| sale_idPK | INT | Unique transaction identifier |
| customer_name | VARCHAR(100) | Name of the customer associated with the transaction |
| sale_amount | DECIMAL(10,2) | Sales amount for the transaction |
| sale_date | DATE | Date on which the transaction occurred |