Level 5 - SeniorScenario-Based Questions
Scenario: Add FK to Dirty Legacy Data
Interviewer prompt: You need foreign key orders.customer_id -> customers.customer_id, but orphan rows exist. Write SQL sequence to detect, fix, then enforce FK.
Schema Context
orders(order_id, customer_id), customers(customer_id)