MySQL 19 - 1NF

719 views

0   0

First normal form (1NF) is the first layer of database normalization. The focus of 1NF is atomicity (singularity). Every column needs to hold only one attribute and only one value for that attribute. This means that columns should not be plural. Additionally, one entity can take up only one row and one row can describe at max one entity.

In our example, we had a column called social_networks. This implies that multiple values can be inserted per row. To fix this, we can make it singular. The downside to this is that you are limited to just one value for that column. If you wanted to have two or more social networks you have to add a table with a foreign key that references the user_id. This allows multiple social networks because multiple rows in the network table can reference a single user.

Finally, we need to make sure that each attribute actually describes the entity. Every column needs to describe the key.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Support me! http://www.patreon.com/calebcurry

Subscribe to my newsletter: http://eepurl.com/-8qtH

Donate!: http://bit.ly/DonateCTVM2.

~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~

More content: http://CalebCurry.com
Facebook: http://www.facebook.com/CalebTheVideoMaker
Google+: https://plus.google.com/+CalebTheVideoMaker2
Twitter: http://twitter.com/calebCurry

Amazing Web Hosting - https://www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)
View More
Comments

0 Comments