Answer the question
In order to leave comments, you need to log in
Website database design. How to create multiple entries with the same data?
Good to everyone!
For example, there is a heading "smartphones". The smartphone has a name. Let's say there are several smartphones with the same name, but different characteristics. How to properly organize the database in order to get a record from the link "site.com/smart/name"? Or how to organize links to records in this case?
Answer the question
In order to leave comments, you need to log in
Separately, a table with the device model + some unique fields such as manufacturer, etc.
The second table with types of characteristics: screen size, amount of memory, etc. No data, just feature names.
The third table contains the model id, feature id, and the value of that feature itself. Also here you need to specify some kind of set id (even just 1, 2, etc. will do). Optionally, sets can also be placed in a separate table, as well as models.
Thus, one model will have several sets of characteristics. But the model itself is available only at one address.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question