There is a product catalog, i.e. category -> product. The problem is that in different categories, the number of fields in the product may vary. For example, if a product is in category1, it has two fields (name, description), if category2, then the product already has 3 fields (name, short description, full description). At the same time, there is one table for products, let's call its items for example. So how best to organize the structure of the database? I see two options: store all possible fields in the items table or create a table under the products fields, i.e something like this
items_fields
id item_id field_name
But then you need another table for the contents of the fields,
fields
id items_fields_id content
the result is too difficult.
Can someone advise more options?
Thank you all, I decided to stop on the variant with several tables.