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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -