Altimetrik's internal workforce platform must identify employee accounts that share the same email address. Write a PostgreSQL query that finds every duplicated non-null work_email and summarizes the affected accounts.
NULL email values from duplicate detection.active.LEFT JOIN so account status information does not remove duplicate accounts without a status row. Sort by duplicate count descending, then email ascending.| Column | Type | Description |
|---|---|---|
| account_idPK | INTEGER | Unique employee account identifier |
| work_email | VARCHAR(255) | Employee work email used for duplicate detection |
| created_at | DATE | Account creation date |
| Column | Type | Description |
|---|---|---|
| account_idPK | INTEGER | Account identifier associated with a status |
| status | VARCHAR(20) | Current account status |