Use COUNT(DISTINCT) to find unique customers
Before the board prep I'm sanity-checking row counts across our dims — quick one, how many distinct customer_ids are in `dim_customers`? Just the baseline number. Finance has its own customer count from billing and it doesn't match ours; I'll chase the actual dedupe separately, but for the board I want our table's count locked in first.
| Column | Type | Key |
|---|---|---|
| customer_id | INT | PK |
| first_name | TEXT | |
| last_name | TEXT | |
| TEXT | ||
| signup_date | TEXT | |
| city | TEXT | |
| state | TEXT | |
| age | INT | |
| gender | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
Use `COUNT(DISTINCT customer_id)` on `dim_customers` instead of `COUNT(*)` — DISTINCT ensures each ID is counted once
You can alias it: `SELECT COUNT(DISTINCT customer_id) AS total_customers FROM dim_customers`
The result should be a single row with one number. If you're getting multiple rows, remove any GROUP BY