S
S
Sugarray2015-09-09 20:23:00
MySQL
Sugarray, 2015-09-09 20:23:00

How to properly design a base; data consistency?

The question torments me all day) There are about 20 types of users (classic first name last name, etc.) and for each of them there are unique fields. How to design the base in such cases? Really for everyone the table?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-09-09
Protko @Fesor

ideally yes. there is also table inheritance , there is also EAV, but I think the first option is more suitable for you.

S
Stanislav Makarov, 2015-09-10
@Nipheris

> and for each of them there are unique fields
And how will these fields be used? Groupings/filters/aggregation on them will be?
If there are, then there are really 20 tables (and this is normal, because then you will have enough code for each type of user). And inheritance patterns - concrete table , single table , class table .
If not (i.e. these fields will be read/written in their entirety) - maybe in JSON their field?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question