Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Download this submission 1 :Implement Phone entity 3 / 3 Your result Field Type Null Key Default Extra phone _ id int NO PRI NULL

Download this submission
1:Implement Phone entity
3/3
Your result
Field Type Null Key Default Extra
phone_id int NO PRI NULL
country_code int NO NULL
phone_number int NO NULL
phone_type varchar(12) YES NULL
2:Drop phone column from address table
1/1
Your result
Field Type Null Key Default Extra
address_id smallint unsigned NO PRI NULL auto_increment
address varchar(50) NO NULL
address2 varchar(50) YES NULL
district varchar(20) NO NULL
city_id smallint unsigned NO NULL
postal_code varchar(10) YES NULL
location geometry NO NULL
last_update timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
3:Implement Customer-Has-Phone relationship
0/1
Your result
Field Type Null Key Default Extra
customer_id smallint unsigned NO PRI NULL auto_increment
store_id tinyint unsigned NO NULL
first_name varchar(45) NO NULL
last_name varchar(45) NO MUL NULL
email varchar(50) YES NULL
address_id smallint unsigned NO MUL NULL
active tinyint(1) NO 1
create_date datetime NO NULL
last_update timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES MUL NULL
Expected result
Field Type Null Key Default Extra
customer_id smallint unsigned NO PRI NULL auto_increment
store_id tinyint unsigned NO NULL
first_name varchar(45) NO NULL
last_name varchar(45) NO MUL NULL
email varchar(50) YES NULL
address_id smallint unsigned NO MUL NULL
active tinyint(1) NO 1
create_date datetime NO NULL
last_update timestamp YES CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES UNI NULL
4:Implement Staff-Has-Phone relationship
0/1
Your result
Field Type Null Key Default Extra
staff_id tinyint unsigned NO PRI NULL auto_increment
first_name varchar(45) NO NULL
last_name varchar(45) NO NULL
address_id smallint unsigned NO MUL NULL
picture blob YES NULL
email varchar(50) YES NULL
store_id tinyint unsigned NO MUL NULL
active tinyint(1) NO 1
username varchar(16) NO NULL
password varchar(40) YES NULL
last_update timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES MUL NULL
Expected result
Field Type Null Key Default Extra
staff_id tinyint unsigned NO PRI NULL auto_increment
first_name varchar(45) NO NULL
last_name varchar(45) NO NULL
address_id smallint unsigned NO MUL NULL
picture blob YES NULL
email varchar(50) YES NULL
store_id tinyint unsigned NO MUL NULL
active tinyint(1) NO 1
username varchar(16) NO NULL
password varchar(40) YES NULL
last_update timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES UNI NULL
5:Implement Store-Has-Phone relationship
0/1
Your result
Field Type Null Key Default Extra
store_id tinyint unsigned NO PRI NULL auto_increment
manager_staff_id tinyint unsigned NO UNI NULL
address_id smallint unsigned NO NULL
last_update timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES MUL NULL
Expected result
Field Type Null Key Default Extra
store_id tinyint unsigned NO PRI NULL auto_increment
manager_staff_id tinyint unsigned NO UNI NULL
address_id smallint unsigned NO NULL
last_update timestamp NO CURRENT_TIMESTAMP DEFAULT_GENERATED on update CURRENT_TIMESTAMP
phone_id int YES UNI NULL
6:Implement foreign key rules for customer table
1/1
Your result
UPDATE_RULE DELETE_RULE COLUMN_NAME REFERENCED_TABLE_NAME
CASCADE SET NULL phone_id phone
7:Implement foreign key rules for staff table
1/1
Your result
UPDATE_RULE DELETE_RULE COLUMN_NAME REFERENCED_TABLE_NAME
CASCADE SET NULL phone_id phone
8:Implement foreign key rules for store table
1/1
Your result
UPDATE_RULE DELETE_RULE COLUMN_NAME REFERENCED_TABLE_NAME
CASCADE SET NULL phone_id phone

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

Step: 3

blur-text-image

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

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions