The scenario
A single-location bookstore needs to track books, authors, publishers, customer orders, order line items, and payments while keeping stock and sales data consistent.
What is in this drawing
Read the decisions behind it.
01
Many-to-many book-author relationship modeled with a BookAuthor join table.
02
Order and OrderItem use a composite primary key to prevent duplicate line items.
03
Separate Payment table allows multiple payments against a single order.
Use when modeling inventory and sales transactions for a small to mid-size retail bookstore that requires clean relational structure.
More like this