Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database schema for an online shop

So I'm fiddling with how you could design the basic db schema for a webshop. Sure, there's a lot of missing details here and there, but I just want to get the most basic stuff right.

Some basic requirements for the shop, which I'm trying to make a schema of:

The shop has an inventory of products. Each product has a price, but this price should vary depending on sales. Customers can make orders for multiple products at a time, and should be able to see their order history. When the order has been completed, there should be a track and trace number.

So, the following image is what I've come up with so far. I'm sure something is missing, I'm just not really sure what, also how to model the dynamic price aspect.

enter image description here

like image 773
Left4Cookies Avatar asked Feb 24 '16 20:02

Left4Cookies


People also ask

How is database used in online shopping?

In an e-commerce application, the main purpose of a database is to store information for retrieving the product details, customer information, track transactions, and further, maintain the inventory. One of the biggest benefits of using a database for e-commerce is structuring vast amounts of shop data.

What is an example of a database schema?

For example, in the Oracle Database product, a schema represents only a part of a database: the tables and other objects are owned by a single user. Note: In SQL, a view is a virtual table that is based on the result-set of a statement. A view contains both rows and columns.

What are the 3 types of schema in the database?

Schema is of three types: Logical Schema, Physical Schema and view Schema. Logical Schema – It describes the database designed at logical level. Physical Schema – It describes the database designed at physical level. View Schema – It defines the design of the database at the view level.

Which database is best for shopping website?

As you can see, the NoSQL databases perfectly match the requirements and needs of the e-commerce market in terms of data availability and storage. Currently, the most popular database system of this type is MongoDB.


2 Answers

enter image description here

I think this is the according to your question give a flow of it how to create a schema and Additional that Link here please visit once you will find some amazing part.

like image 69
Jitendra Avatar answered Oct 01 '22 21:10

Jitendra


A common way to handle variable price would be to introduce a rebate schema. This can be implemented as association class between Product and Sale by adding some rebate to amountSold. Of course there are many different ways, but this is one at hand.

  • I'm missing a relation between Order and Customer.
  • Not sure what you intend with the Inventory aggregating ProductList. To me a Inventory lists Product. There might be the need to a store location and a PurchasePipe
like image 36
qwerty_so Avatar answered Oct 01 '22 22:10

qwerty_so