MySQL 12 - Referential Integrity

submitted by mkenny400 on 03/20/18 1

The concept of referential integrity is protecting relationships in our database. As a reminder, a relationship is when we have a foreign key reference another column. This column is usually the primary key of another table. This is a foreign key connection. If by any chance we establish a database structure where a table references another table, but we don't enforce this any way, the data in the table that is being referenced could be deleted, but the reference would still exist. If this happened, we would be breaking our referential integrity. We protect this by using referential constraints. A referential constraint tells the database that there is a connection between the two columns. This will allow you to configure what happens when the table being referenced gets updated or deleted. Another important thing to protecting referential integrity it to design the database in the correct way. This requires in depth knowledge of different types of relationships. How do you know when you need to put things in separate tables? We discussed all of the relationship possibilities in previous videos. In summary, relationships are not just something we assume… They are objectively defined so that the database knows they exists. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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)

×