Learn VisualLearn DB Visual
JA

Translate Each Modeling Decision

Each entity becomes a table, each attribute becomes a column, and each chosen identifier becomes a primary key. A one-to-many relationship places a foreign key on the many side. The Customer–Order relationship therefore becomes orders.customer_id, while the associative entity becomes the order_items table. Category is also a separate table referenced by products.category_id.

Where should the foreign key for the Category–Product one-to-many relationship go?