Write a query or processing step to identify duplicate user profiles based on conflicting email and device identifiers.
Treat two profiles as duplicates when they share the same non-null email address or the same non-null device identifier. Return each unordered profile pair once.
profile_id_1, then profile_id_2.profile_id_1, profile_id_2, profile_name_1, profile_name_2, conflict_type, shared_email, and shared_device.conflict_type must identify an email conflict, device conflict, or both. Use NULL when a shared identifier does not apply.| Column | Type | Description |
|---|---|---|
| profile_idPK | INT | Unique user profile identifier |
| profile_name | VARCHAR(100) | Display name associated with the profile |
| Column | Type | Description |
|---|---|---|
| profile_idPK | INT | User profile identifier |
| VARCHAR(255) | Email associated with the profile | |
| device_id | VARCHAR(100) | Device identifier associated with the profile |