I will have several different types of users who will use my system. For all users, I need to store things like username, password, email address, etc., But if they are users of category A, I also need to store values โโfor fields a, b and c, but if they are users category B, I need to save the values โโfor the fields d, e, f and g.
USER ------- id username password CAT_A -------- id a b c CAT_B -------- id d e f g
Most likely, I need to use some kind of bridge table to associate the user with one of the CAT tables, but how can I do this? I can not use something like this:
EXTEND -------- user_id cat_id
Because I donโt know which CAT table the cat_id refers to. Do I need a field for each of the categories? If so, this does not seem to be normalized, as there will be many empty fields, especially if I have 3 categories.
EXTEND -------- user_id cat_a_id cat_b_id ...
Any entry is welcome!
Nighthawk
source share