For customers that currently live in Seattle, what is the most common city they lived in previously? (ADDRESSES has customer_id, start_date, end_date, city...)
Asked in the technical phone screen stage. Tables include ORDERS, ITEMS, and ADDRESSES.
city and previous_customer_count.end_date.city.| Column | Type | Description |
|---|---|---|
| address_idPK | INTEGER | Unique address history record identifier |
| customer_id | INTEGER | Customer associated with the address |
| start_date | DATE | Date the customer began living at the address |
| end_date | DATE | Date the customer stopped living at the address; NULL indicates the current address |
| city | VARCHAR(100) | City of the customer's address |