Database Relationships  «Prev  Next»

Lesson 7

MS Access Referential Integrity Conclusion

This module discussed working with relationships within Access and using referential integrity. In this module, you learned how to:
  1. Identify different types of relationships used in Access
  2. Create one-to-one and one-to-many relationships
  3. Create a many-to-many relationship
  4. Use relationships to manage referential integrity
  5. Set the Cascade Update and Cascade Delete options for relationships

Cascade Update and Cascade Delete effect Access Referential Integrity

Cascade Update and Cascade Delete are options in Access that determine what should happen to related records when a record in the primary table is updated or deleted. These options are used to enforce referential integrity, which is a concept that ensures that relationships between tables remain consistent.
When the Cascade Update option is selected, any related records in the foreign table will be automatically updated when the primary key value in the primary table is changed. This helps to ensure that the relationships between tables remain consistent.
When the Cascade Delete option is selected, any related records in the foreign table will be automatically deleted when the corresponding record in the primary table is deleted. This helps to prevent orphan records in the foreign table and ensures that relationships between tables remain consistent.
Overall, Cascade Update and Cascade Delete are useful tools in Access for enforcing referential integrity, as they help to maintain the consistency of relationships between tables.

Creating Relationships and enforcing Referential Integrity

The Relationships window lets you establish the relationships and referential integrity rules that you want to apply to the tables involved in a relationship. Creating a permanent, managed relationship that ensures referential integrity between Access tables is easy:
  1. Select Database Tools . Relationships. The Relationships window appears.
  2. Click the Show Table button on the Ribbon, or right-click the Relationships window and select Show Table from the shortcut menu. The Show Table dialog box (shown in Figure 2.7) appears.

Double-click a table name to add it to the Relationships window.
Figure 2.7 Double-click a table name to add it to the Relationships window.

Cascade Update - Delete - Quiz

You can take a quiz that will help you verify what you have learned and discover topics that you might want to review in a more detailed manner. Click the Quiz link below to answer a few questions about working with relationships.
Cascade Update - Delete - Quiz