An orders table references customers through a customer_id foreign key
A medium Data Modeling interview practice problem on DataDriven. Write and execute real data modeling code with instant grading.
- Domain
- Data Modeling
- Difficulty
- medium
Problem
An orders table references customers through a customer_id foreign key. Every order must belong to exactly one customer. An employees table references managers through a manager_id foreign key, but the CEO has no manager. Design both tables with the correct nullability on each foreign key.
Practice This Problem
Solve this Data Modeling problem with real code execution. DataDriven runs your solution and grades it automatically.