Working With Multiple Tables Notes Readers Venue_compressed
Working With Multiple Tables Notes Readers Venue_compressed
MASTER Record
Transaction table
PRIMARY KEY
Transaction
Record
Foreign Key
Types of Relationships
One specific record of the master table has more than one
One-to-Many corresponding records in the related transaction table.
Types of Relationships
Referenced
table
Foreign Key
Primary Key
Event
Referencing
table
Referential Integrity
According to the principle of referential integrity, no unmatched foreign key
values should exist in the database. If a record is removed from the parent table,
the corresponding records in the child table must also be updated or deleted.
No action This is the default option. This option states that a user should
not be allowed to update or delete any record in the master
table if any related record exists in the transaction table.
Update cascade This option allows the user to delete or update the
referenced field but along with it all the related records in
any of the transaction tables will also be deleted or updated.
This option assigns NULL value to all the related fields if the master
Set NULL
record is deleted or updated.
This option assigns any fixed default value to all the related fields
Set default
if the master record is deleted or updated.
To set the relationship properties double click on the relation line joining
the two tables. A Relations dialog box will open.
By default the radio button with No action option will be selected.
Choose any of the desired option and click OK to set the referential integrity
between the two tables.