Your question is SQL Average Sales by Region. 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.
NCR Atleos uses regional sales data to review performance across its ATM and payment technology business. Write a PostgreSQL query to calculate the average sale amount for each region.
region and calculate the average of sale_amount using AVG.NULL region when present, and sort alphabetically with the NULL region last.| Column | Type | Description |
|---|---|---|
| sale_idPK | INTEGER | Unique sale identifier |
| region | VARCHAR(50) | Sales region, or NULL when not assigned |
| sale_amount | NUMERIC(12,2) | Sale amount |
| sale_date | DATE | Date of the sale |