You are given CRM data used by a large sales team. Write a PostgreSQL query that returns each active account with a data-quality status showing whether it has missing owner assignment, duplicate contacts, or unresolved email conflicts. Focus on surfacing records that need cleanup rather than fixing them.
| Column | Type | Description |
|---|---|---|
| account_idPK | INT | Primary key for the account |
| account_name | VARCHAR(255) | Account name |
| owner_id | INT | Assigned CRM owner |
| is_active | BOOLEAN | Whether the account is active |
| Column | Type | Description |
|---|---|---|
| contact_idPK | INT | Primary key for the contact |
| account_id | INT | Related account |
| VARCHAR(255) | Contact email address | |
| is_primary | BOOLEAN | Primary contact flag |
| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Primary key for the CRM user |
| full_name | VARCHAR(255) | Owner name |