Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement the diagram in three steps: Step 1 . Create a person supertype table: Create a primary key person _ id with data type SMALLINT
Implement the diagram in three steps:
Step Create a person supertype table:
Create a primary key personid with data type SMALLINT UNSIGNED.
Add the common columns of customer and staff refer to the diagram Specify the same data types and constraints as in customer and staff.
Implement the belongsto relationship as a foreign key constraint on addressid Specify the same foreign key rules as in customer and staff.
Step Drop common columns from customer and staff:
Drop columns that moved to person in step
Do not drop lastupdate, as every Sakila table has this column.
Drop the foreign key constraint on addressid before dropping this column.
Step Implement IsA relationships in customer and staff:
Drop the existing primary key columns.
Add new primary keys personid with data type SMALLINT UNSIGNED.
Implement the IsA relationships as foreign key constraints on personid Specify CASCADE foreign key rules.
HINT: Use ALTER TABLE to add and drop foreign key constraints:
ALTER TABLE customer
ADD FOREIGN KEY personid REFERENCES personpersonid ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE customer
DROP FOREIGN KEY customeribfk;
customeribfk is a symbol representing the first foreign key declared in customer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started