and thanks in advance.
I am trying to normalize a table "People
", where each entry (person) belong to one of many different categories (e.g. "lawyer", "client", "judge"). Some fields are common across categories (e.g., firstName
, lastName
).
However, some (set of) fields are unique to each category: for instance, a "client" will likely not have a "LawyerBoardID
" number. Therefore, an entry will have a value in that field if and only if the person belongs to the "lawyer" category; in other words, that field will be NULL
for all other categories.
This has implications for child tables. One person, many entries in the "Address
" table – textbook example. If I split my "People
" table in many tables – namely, one per category – then I will have to put as many FK in the "Address
" table, right? Therefore, if I have 10 categories, there will be 9 NULL
FKs.
Any suggestion? Links to relevant web pages are also very welcome.
Best Answer
Your case looks like an instance of class/subclass (or, if you prefer, type/subtype). You can find many answers like this one in SO or here in DBA.