Question: This query will require the use of a Foreign Key Constraint. The passengers will be able to remove groups that they have created, in doing

This query will require the use of a Foreign Key Constraint. The passengers will be able to remove
groups that they have created, in doing so the system needs to ensure that the PassGroupMember
table is also cleaned out with records that referenced a removed pass group.
First, Setup a Foreign Key Constraint in Workbench so that the PassGroupMember records are
removed if a PassGroup is deleted.
Use CASCADE on Update and on Delete.
After clicking apply, grab the ALTER TABLE *> ADD CONSTRAINT statement to include for this
query.
Next, create a DELETE statement to remove one family group (GroupTypeID=1) and one business
group (GroupTypeID =2) from the PassGroup table.
Remember your data is different from mine for these tables so I can't provide a specific GroupID
for this query.
Review your PassGroup table and pick two ID's to use in your DELETE statement.
After you run the DELETE query, re-query the PssGroupMember table to show its records and
verify that the referenced records were also removed via the Foreign Key Constraint.
Submit the ADD CONSTRAINT & DELETE statement for the lab.
This query will require the use of a Foreign Key

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!