MySQL Lookup Table + Multiple Constraints in one Lookup Table -


i have table called users has around 50 columns , need add constraints around 30 of 50 columns. typically in past create 30 constraint tables , apply each users table foreign key constraint.

i wanted see if use 1 table 30 constraints?

this 1 table incrementing primary key , 30 columns - 1 each constraint. constraints around 5 entries , around 100 entries there null data in of constraint lists.

is realistic way multiple constraints or need use 1 table per constraint?

thanks

if constraint mean lookup tables, no, not combine them single table. if 1 of fields has 2 possible values , 1 has 3, first 1 still have 3 choices available in lookup table, if 3rd choice linked null.

if worried number of lookup tables, consider using mysql's enum data type instead.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -