MySQL 20 - 2NF

submitted by mkenny400 on 03/20/18 1

Second normal form speaks of partial dependencies. 2NF demands that we remove all partial dependencies. In databases, a column depends on the primary key. In order for us to have a partial dependency we have to have what is known as a composite key. A composite key is a primary key that consists of multiple columns. In our bidding website example, we have a users table, a listings table, and a user_listings table. The primary key in the user_listings table is the combination of a user and a listing id. That's because it is an associate between a user and a listing. Because we have a composite primary key in the user_listings table, we have to make sure that any additional columns depend on both of the columns in the composite key. The example I use in this video is the listing_date that is improperly placed inside of the user_listing table. We get rid of this column and put it in the listings table. What would an appropriate column be? A column saying what percentage of earnings a user gets when an item is sold would be appropriate because it depends on the item and the user. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Support me! www.patreon.com/calebcurry Subscribe to my newsletter: eepurl.com/-8qtH Donate!: bit.ly/DonateCTVM2. ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~ More content: CalebCurry.com Facebook: www.facebook.com/CalebTheVideoMaker Google+: plus.google.com/+CalebTheVideoMaker2 Twitter: twitter.com/calebCurry Amazing Web Hosting - www.dreamhost.com/r.cgi?1487063 (The best web hosting for a cheap price!)

Leave a comment

Be the first to comment

Collections with this video
Email
Message
×
Embed video on a website or blog
Width
px
Height
px
×
Join Huzzaz
Start collecting all your favorite videos
×
Log in
Join Huzzaz

facebook login
×
Retrieve username and password
Name
Enter your email address to retrieve your username and password
(Check your spam folder if you don't find it in your inbox)

×