Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Refer to the address, store, staff, and customer tables of the Sakila database. In this lab, these tables initially have the same columns as in

Refer to the address, store, staff, and customer tables of the Sakila database. In this lab, these tables initially have the same columns as in Sakila, however some constraints are different.
The customer and staff tables have many common columns. Move these columns to a new supertype table person, as shown in the following diagram:
The diagram has five entities and two relationships. The entities are person, staff, customer, address, and store. Person is a super type entity, with subtypes staff and customer. Staff appears above customer, within person. Address and store appear outside person. Person has attributes person_id R U, first_name, last_name, email, active, and last_update. Staff has attributes person_id R U, picture, username, and password. Customer has attributes person_id R U and create_date. Address and store have no attributes. Relationship address-belongs_to-person has cardinality one-many maximum and one-zero minimum. Relationship staff-works_at-store has cardinality many-one maximum and zero-one minimum.
Follow Sakila conventions for table and column names:
All lower case
Underscore separator between root and suffix
Foreign keys have the same name as referenced primary key
Implement the diagram in three steps:
Step 1. Create a person supertype table:
Create a primary key person_id 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 belongs_to relationship as a foreign key constraint on address_id. Specify the same foreign key rules as in customer and staff.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases A Beginners Guide

Authors: Andy Oppel

1st Edition

007160846X, 978-0071608466

More Books

Students also viewed these Databases questions

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago