The request
“An online bookstore database with customers, books, authors, publishers, categories, orders, order lines, and reviews. Books have publishers and categories, books and authors are many-to-many, customers place orders and write reviews.”
Then tryAdd a shopping cart for each customerAdd a wishlist table for books
What is in this drawing
Read the decisions behind it.
01
Used a junction table BookAuthor to resolve the many-to-many relationship between books and authors.
02
Modeled reviews as a separate entity so customers can rate and comment on any ordered book.
03
Placed ISBN as a unique key on Book to enforce one-record-per-edition uniqueness.
Reuse this structure when building an e-commerce database that requires product inventory, customer accounts, order history, and user-generated reviews with ratings.
More like this