E
E
Evgeny Petryaev2019-05-27 21:50:12
Database design
Evgeny Petryaev, 2019-05-27 21:50:12

Design a table?

For the application, both web and desktop, and it is possible that a table is needed for smartphones. The principle is this: select* rows are taken (or rather, a column of one or more?) most likely by id == %num_id%. There are values ​​from auto1-auto15,moto,wild. That is, 17 values, how to write them into 30 cells? Each column? Or in one line in one column with delimiters? What separators? How is it better? So that you can parse it later.
In short, for the uninitiated:

|id|data                             |control_sum                |
|1|"auto1-auto2-...-auto15"| asf212214sg14fsgfss|
...
|n|"auto1-auto3-...-auto14"|asfg45545125safggfs|
или
|id|col_1  |col_2   |...|col30     |sum                       |
|1|"auto1"|"auto1"|...|"auto15"|asddasdasfsgsfg42|
..........................................................................

?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitsliputsli, 2019-05-27
@Vitsliputsli

Depending on how you will use it. If you take everything together by id, then there is no reason to split it, especially considering the possible change of keys. In this case, I would put everything in json if the DBMS supports this data type. If the keys are so important that sooner or later queries will be built on them, then use the advantages of storing data in relational DBMS.

G
grinat, 2019-05-28
@grinat

I didn’t understand anything, but I think this will help you https://habr.com/en/post/193380/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question