Problem Description

You are loading Orders first, then Customers later. How will you prevent orphan customer_id in Orders? Write a staging-table approach.

Input Format

SQL DDL + DML

Output Format

DDL/DML statements

Sample Test Case

Input:
OrdersStaging, Customers, Orders
Output:
Clean final Orders

Constraints

Use staging and validate before final insert

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next