DB Design Ecommerce Products
DB Design Ecommerce Products
eCommerce Products
Ben Brumm
www.databasestar.com
Database Design: eCommerce
Products
This guide is a companion to my YouTube video on designing the product area of an eCommerce
website. The video used the website asos.com as an example, but the design should work for other
eCommerce solutions.
● An Entity Relationship Diagram for the product area of an eCommerce website, from my
YouTube video.
● An explanation of the purpose of each table and field, with sample data.
● SQL scripts to create each of these tables with some sample data.
https://dbshostedfiles.s3.us-west-2.amazonaws.com/dbs/erd_ecommerce_products.png
Guide Title
SQL Scripts
The SQL Script to create this database, and populate some sample data, is available on GitHub here:
https://github.com/bbrumm/databasestar/tree/main/videos/127_ecommerce
The script has been written for MySQL, but with some minor tweaks (such as data types), it should
work for all other databases.
Database Definition
This section explains each of these tables and fields.
product_image
colour
colour_name The name of the colour, which is shown on Black, Blue, White
the web page.
www.DatabaseStar.com 2
Guide Title
product_category
A record for each of the product categories. This table contains a self-join, so it contains many levels of
categories and subcategories.
category_description A description for the category which is Check out our collection of
shown on the web page shoes from a range of brands,
and find….
product
A record for each product, which is shown on the product listing page.
product_name The name of this product, shown on the Black Leather Jacket
www.DatabaseStar.com 3
Guide Title
product listing page and the product Nike Air Force Shoes
page. Long Black Dress
product_description A description of the product to provide This jacket is part of our new
more information collection and is designed…
care_instructions Any instructions on how to wash, dry, or Mashine wash, cold only
care for the product
about Some information about the product Made with 100% cotton
product_item
A record for a product that comes in a different colour and has a different price.
original_price The price of a product, or its original price 10, 150, 210
if it is on sale
brand
www.DatabaseStar.com 4
Guide Title
row.
brand_name The name of the brand that creates a Nike, Adidas, Gucci
product
brand_description A description of the brand to explain more Founded in 1976, the company
about it. specialises in quality…
product_variation
A record for a product item that comes in a specific size. It is represented by a quantity in stock and
this is what is ordered by customers.
size_category
A record that represents a category of sizes, such as "Shoes" and "Women's Pants", so the website can
show the correct size options for a category.
size_option
www.DatabaseStar.com 5
Guide Title
product_attribute
A combination of products and the attributes that apply to them, which is used for filtering.
attribute_option
A record for all of the available options for different attributes of a product.
www.DatabaseStar.com 6
Guide Title
attribute_type
Conclusion
Hopefully you found this guide, diagram, and script useful.
Thanks!
Ben Brumm
www.DatabaseStar.com
www.DatabaseStar.com 7