Question: Cascading Referential Actions
Explore how to create foreign key constraints with ON UPDATE CASCADE and ON DELETE CASCADE actions in SQL. Understand managing related records with cascading referential actions by completing a CustomerAddresses table. Gain hands-on experience ensuring data integrity during updates and deletions in advanced database objects.
We'll cover the following...
Question
Given the following structure of the Customers table:
Field | Type |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where, CustomerID is the primary key and ReferralID is self-referencing to CustomerID. The table contains information about customers. In the table, each customer is categorized by a CustomerTier to reflect their engagement level. The possible values are 'New', 'Regular', and 'VIP'.
The operations team wants to ...