There are two tables:

Category

id | name | description

and

Product

id | category_id | name | description

There is a need to add / edit / delete custom attributes through categories through the admin panel, and also - through the admin panel - values ​​of the attributes of goods. For example, there are the following categories: Продукты питания , Техника . It is necessary for Продуктам питания add the attribute Энергетическая ценность , and Технике - Потребляемая мощность .

1st question: how to organize the data?

2nd question: with what query, will it be possible to choose the whole Технику with Потребляемой мощностью from 100 to 200 W?

3rd question: what query will be possible to edit / delete unnecessary attribute

    1 answer 1

    Need more tables. There are at least two more: the attribute definition table (name, title, type), whose records are keyed to categories, and the attribute values ​​table, which are linked to two keys in the definition table and to the products table. All this requires well-thought indices.

    • More? - Vitalii Del Vorobioff