Without using pandas (dictionaries, lists, for loops), join the datasets and calculate average income by country.
Asked in the Jupyter live coding (Python) stage. Question 3 of 3; requires joining data and aggregating using plain Python data structures. For this SQL version, use the supplied customer and income tables.
country_code, average_incomeaverage_income to two decimal places and sort by country_code ascending| Column | Type | Description |
|---|---|---|
| customer_idPK | INT | Unique customer identifier |
| country_code | VARCHAR(2) | Two-letter customer country code |
| Column | Type | Description |
|---|---|---|
| income_idPK | INT | Unique income record identifier |
| customer_id | INT | Customer associated with the income record |
| annual_income | NUMERIC(12,2) | Reported annual income |