Enforce referential integrity

Keyboard Shortcuts

Referential integrity is another integrity constraint that ensures that a value in a child table has a related value in a parent table. Without this protection in place, orphaned records can be created that don’t properly connect to related information in

- [Voiceover] One of the ways that we can prevent…invalid entries in a child table…is by placing a specific kind of data constraint…on the relationship between a child table…and the parent.…This constraint is called referential integrity.…Referential integrity ensures that related records…in the child table actually point to something…in the parent's table.…Let's take a look at an example of how this works.…Here we have our employees table…and the departments table,…which have a one to many relationship between them.…Each employee is supposed to point to a single department,…but here's the problem.…Our database is currently not set up to protect us…from erroneous data getting entered…in the department field in the employees table.…

For instance, we can create a reference…to a department that doesn't exist,…such as if we add someone to the maintenance department.…When this occurs, we have what is called…an orphaned record.…This means that this particular line item…doesn't refer to any department at all,…which is clearly a problem.…

Resume Transcript Auto-Scroll

Author

Released

9/27/2017

Have you ever opened up a database that someone else built and felt a little lost? Or ever thought of designing your own simple database and been unsure of where to start? Or perhaps you need to work with a team of database professionals and don't know how to speak their language? This course can help you overcome these hurdles.

Adam Wilbert covers the basics of relational database design, regardless of whether you use Access, FileMaker, Open Office, or SQL Server. Learn how to prevent data anomalies, gather requirements to plan your design, and develop a conceptual data model—translating your ideas into components like tables, relationships, queries, and views. Plus, learn about logical design considerations that can help you construct a database that is easy to maintain.