Home > database >  Consult a dictionary table if there is any need, what are the benefits?
Consult a dictionary table if there is any need, what are the benefits?

Time:03-20

In database design is generally a dictionary list, usually containing fields: type, code, value, for example: XBDM, 10001, male; XBDM, 10002, female,
Data records are stored the corresponding code, the query needs associated with a dictionary table, remove the associated code of values, for example: select xm, ZDZ xb from t1 left join t_zt on t1. XBM=t_zt. Dm and t_zt. Lx='XBDM', if there are a lot of code associated fields requires a lot of time, but also very troublesome,

Question:
Can field directly to store the corresponding value (for example: male), I feel this is better, and the import and export the better operation, of course, if directly stored value is the premise of code, you don't need the dictionary storage also allows,

Forget the environment! Look at the
  • Related