Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 808655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:35:50+00:00 2026-05-15T00:35:50+00:00

I new in database design, I want to be sure that i make it

  • 0

I new in database design, I want to be sure that i make it well.
Please take a look for part of my database design:

My database design for basic shopping cart:

//table that holds shopping cart items that customer choose(not press checkout and order //them)

**shopping_cart**
{
id (int)
product_id (int) fk
product_quantity (int)
customer_user_id (int) fk 
}

//table that holds product order data in time of checkout.(i hold them because supplier //can change after time products attributes value add some attributes or delete and change //the price of product)

**order**
{
id (int)
product_id (int)  fk
customer_user_id (int)  fk
}


//table that connect order  to attribute table for products attributes value in the moment //of   checkout

**order_attributes**
{
id (int)
order_id (int)  fk
attribute_id (int)  fk
}

//main product table
**product**
{
id (int)
sku (int) 
product_name (varchar)
supplier_user_id (int)  fk
}

//connection table many to many 
**product_attributes**
{
id (int) 
product_id (int)  fk
attribute_id (int)  fk
}

//table that holds products attributes (price, weight, color + new attributes that user //will create)

**attribute**
{
id (int)
product_id (int)  fk
attribute_name (varchar)
attribute_value(varchar)
}

Thanks you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T00:35:50+00:00Added an answer on May 15, 2026 at 12:35 am

    For my money, it is a poor design becasue it uses attribute tables whe are EAV tables and which can cause performance problems. Take the time to actually define the attributes you want to have for the products, there really are mostly simliar for most products (color, size, units(package of 10, single item, etc.). EAV is the last resort.

    Store the details of the prices, etc, in the orderdetail table. You do not want the price to change if the product price changes later on down the road.

    My structure would be somthing like:
    Order
    orderid, date, customerid
    Order details
    order_id,Compnay_id,Product_id, part_number,product_name, quantity, price, Unit, Color, size, other attributes
    Order notes
    order_id, note

    Products
    product_id,Part_number, product_name, Company_id, product price, color, size, Unit

    Better to have null columns (unless you have hundreds of attributes which you won’t generally) when some products don’t have the same attrubutes)
    Further if you want complete specs for a product, consider puttingthem in a large varchar filed and putting a full text index on it. This should perform way better than an EAV table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As this question is sure to reveal, I'm relatively new to database design. Please
I am new to database schema design and I want to learn more about
I'm really new to database object design so please forgive any weirdness in my
I'm thinking on new design for database. And I want to use Table-Per-Type inheritance
I'm creating a new PHP application and want to make sure I get the
I am pretty new to database design. I am building a small asp.net mvc
I'm new to database design and just wanted a few opinions as to whether
I am quickly learning the ins and outs of database design (something that, as
Simply put: I have a database design in my head and I now want
Hey im new to database design and having trouble trying to figure this one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.