U
U
Uzair Izha2016-03-31 18:50:02
PHP
Uzair Izha, 2016-03-31 18:50:02

How to make a database structure correctly?

How to properly structure the database of an online store?
Each product can have different characteristics, and these characteristics are selected from the database when adding the product. For example, the Phone product has memory, but the Stiralka product does not.
I am describing all this to the fact that I need to make a filter for such different products that may have different characteristics. How to make the structure correctly - products, characteristics and filters.
How does the table structure for filters look in general? I'm doing this for the first time, I want to achieve flexibility, in order to make it easier to work with data

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
Rsa97, 2016-03-31
@Rsa97

Product table (id, group_id, name, price, balance, ...)
Attribute table (id, name, type)
Table of possible attribute values ​​(attribute_id, value)
Table of possible product characteristics (group_id, attribute_id, required)
Product characteristics table ( product_id, attribute_id, value)
This is the bare minimum.

H
hscode, 2016-03-31
@hscode

I think it's not difficult to enter such a request in Google and study everything yourself.
Let's just say, study a lot of examples, and find good and bad places in them.
"Example of product database structure"

S
semki096, 2016-03-31
@semki096

You can put opencart - out of the box it seems there are tables with the necessary fields. Import, edit for yourself. As an option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question