Every Line Remembered
A medium Data Modeling interview practice problem on DataDriven. Write and execute real data modeling code with instant feedback.
- Domain
- Data Modeling
- Difficulty
- medium
- Seniority
- L5
Problem
You are handed the transactional database behind a retail chain: orders, customers, products, stores (some of them digital storefronts with no physical location), and employees, where a single order spans several line items, each for a different product. Redesign it as a dimensional warehouse that keeps every line item as its own record, so product-mix, per-line sales, and customer-behavior reporting stays a simple roll-up. Watch two quirks the source carries: product identifiers get reused when a retired item relaunches, and a sale must keep showing the customer's address as it stood on the order date even after the customer later moves.
Summary
Customers move, products relaunch, and some stores have no address. Reshape the tables so nothing gets forgotten.
Practice This Problem
Solve this Data Modeling problem with real code execution. DataDriven runs your solution and checks it automatically.