Answer the question
In order to leave comments, you need to log in
Optimal database structure. How to organize correctly?
Friends. Now the data of each user is written to the database in the standard way:
id info skype adress - and so on.
The site is narrowly thematic, so it is necessary that each user can fill out his own price list. Rather, simply indicate the prices for the list proposed in advance
. Here is the question. I suppose you need to create a new table like:
id (user) item_name1 (product name) item_price1 (price) item_name2 (product name) item_price2 (price)
The difficulty is that there are more than 200 elements (item_name). You will have to inflate the table or you can make it more optimal ?
Thank you.
Answer the question
In order to leave comments, you need to log in
There is no such thing as an optimal data structure at all. In this case, you can, for example, create two additional. tables:
item_name (id, name);
item_user_price(id_user, id_item, price);
Separate table of users.
Separate table of products.
A third table that combines user id, product id, plus price.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question