mysql - First normal form violation -
mysql - First normal form violation -
let's user can have multiple phone numbers.
i can understand first table below violation of 1nf, userid=2
repeated.
+--------+-------+ | userid | phone | +--------+-------+ | 1 | 1010 | | 2 | 1020 | | 2 | 1021 | | 3 | 1030 | +--------+-------+
but sec table violation of 1nf ? yes, appears bad, inflexible design - violating 1nf ?
+--------+--------+--------+ | userid | phone1 | phone2 | +--------+--------+--------+ | 1 | 1010 | | | 2 | 1020 | 1021 | | 3 | 1030 | | +--------+--------+--------+
it violation of 1nf. 1nf requires that
there no multiple-valued fields in table. there no repeating groups in table.phone1
, phone2
etc repeating groups, violation of 1nf.
repetition of userid=2 not violate 1nf itself.
mysql sql database relational-database normalization
Comments
Post a Comment