Answered step by step
Verified Expert Solution
Question
1 Approved Answer
database design 2 . 1 1 LAB - Implement supertype and subtype entities ( Sakila ) Refer to the customer and staff tables of the
database design LAB Implement supertype and subtype entities Sakila Refer to the customer and staff tables of the Sakila database. These tables have many columns in common and represent simile entities. Convert the customer and staff entities into subtypes of a new supertype person person address person id firstname belongs to lastname email MOJ active tastupdate staff person id picture username password worksat MO store customer person id create, date The diagram uses Sakita naming conventions. Follow the Sakila conventions for your table and column names All lower case Underscore separator between root and suffix Foreign keys have the same name as referenced primary key Implement supertype and subtype entities as person, customer and staff tables with primary key personid Implement attributes as columns All columns are NOT NULL The person id columns have data type SMALLINT UNSIGNEDAll columns are NOT NULL The personid columns have data type SMALLINT UNSIGNED The lastupdate and createdate columns have data type TIMESTAMP The picture column has data type BLOB All other columns have data type VARCHAR Implement the dependency relationships between subtype and supertype entities as foreign keys: The personid columns of customer and staff become foreign keys referring to person Specify CASCADE actions for both relationships. Implement the belongs to and worksat relationships as foreign keys: belongsto becomes an addressid foreign key in person referring to address. worksat becomes a storeid foreign key in staff referring to store Specify RESTRICT actions for both relationships The address and store tables with primary keys addressid and storeid are predefined in the zyLab environment Foreign keys must have the same data types as the referenced primary keys: addressid has data type SMALLINT UNSIGNED storeid has data type TINYINT UNSIGNED If you execute your solution with the Sakila database, you must first drop customer, staff, and all constraints that refer to these tables Use the following statements with Sakila only, not in the zyLab environment DROP TABLE customer, staff; ALTER TABLE payment DROP CONSTRAINT fk payment customer, DROP CONSTRAINT kpaymentstaff: ALTER TABLE rentalDROP TABLE customer, staff ALTER TABLE payment DROP CONSTRAINT Ekpayment customer, DROP CONSTRAINT Ekpaymentstaff; ALTER TABLE rental DROP CONSTRAINT fkrentalcustomer, DROP CONSTRAINT fkrental staff; ALTER TABLE Store DROP CONSTRAINT fkstorestaff: LAB ACTIVITY : LAB Implement supertype and subtype entities Sakila Main.sql Load default template Your CREATE TABLE statements go here
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