Write a SQL query to identify records with missing or duplicate primary keys.
Use the qa_import_records table. Return each problematic record_id once, including a count and an issue classification. NULL record_id values represent missing keys and must be included. Order missing keys first, followed by duplicate keys in ascending key order.
record_id, record_count, and issue_typeissue_type must be MISSING or DUPLICATE| Column | Type | Description |
|---|---|---|
| record_id | INTEGER | Candidate record identifier imported from the source system |
| source_rowPK | INTEGER | Unique row number assigned during the import |
| test_name | VARCHAR(150) | Name of the QA test record |
| source_system | VARCHAR(100) | System that supplied the imported record |