Your question is Find Duplicates in SQL. Start with the requirements and the one table on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ryan Specialty needs to identify duplicate policy records in a staging table before loading data into the core system. Write a SQL query to find every policy_number that appears more than once.
policy_numberpolicy_number ascending| Column | Type | Description |
|---|---|---|
| record_idPK | INT | Unique row identifier |
| policy_number | VARCHAR(50) | Policy identifier from the source feed |
| insured_name | VARCHAR(255) | Named insured on the policy |
| effective_date | DATE | Policy effective date |
| premium_amount | DECIMAL(12,2) | Written premium for the record |