Is normalization of database is correct?
I am using mysql databse,with two tables serviceTypeDetails,validateConfig.
serviceTypeDetails validateConfig ---------------------- ------------------ servicetypeid(pk) servicetypeid(fk) servicetypename fieldname modeType ----------------------------------------------------
In serviceTypeDetails,it's having four types of services and another table validateconfig contain 31 row with r开发者_运维技巧espect to each servicetypeid.this schema is correct.if not then what modification it required?
Thanks
Yes, you're using the schema right. This models a one-to-many relationship between serviceTypeDetails and validateConfig, so there can be more validateConfig records attached to each serviceTypeDetails record.
I only would include a composite primary key in the validateConfig table, obviously keeping the FK in servicetypeid. I suppose {servicetypeid, fildname} works.
No one can say whether a data model is "correct" or not without knowing what it is supposed to represent in the domain of discourse, what dependencies and business rules it is supposed to enforce, etc.
What we can be sure of is that validateConfig appears not to have any candidate keys in your example. If that is the case then I suggest you fix that.
精彩评论