Relative Content

Tag Archive for database-design

Data Model for selling groups of products as one product

Say I have an e-commerce with a data model like the following, which allows a Sale to describe how a single Product is sold. This division allows a product to be sold multiple times in different ways (different pricing, or offered at a different point in time). This works great when a sale is selling a single product.

Data Model for selling groups of products as one product

Say I have an e-commerce with a data model like the following, which allows a Sale to describe how a single Product is sold. This division allows a product to be sold multiple times in different ways (different pricing, or offered at a different point in time). This works great when a sale is selling a single product.

should I store common data between two tables in a third separate table in my database?

If I have 2 tables in my database, let’s say for instance ‘buyers’ and ‘sellers’ but I collect a common set of data for both for instance telephone number, email address, address etc. Is it better practice to have one common table for ‘contact_details’ with a reference to the table and row that the contact details are for, or as they are seperate entities are they better off in seperate tables entirely?