Answered step by step
Verified Expert Solution
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
:Implement Phone entity
Your result
Field Type Null Key Default Extra
phoneid int NO PRI NULL
countrycode int NO NULL
phonenumber int NO NULL
phonetype varchar YES NULL
:Drop phone column from address table
Your result
Field Type Null Key Default Extra
addressid smallint unsigned NO PRI NULL autoincrement
address varchar NO NULL
address varchar YES NULL
district varchar NO NULL
cityid smallint unsigned NO NULL
postalcode varchar YES NULL
location geometry NO NULL
lastupdate timestamp NO CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
:Implement CustomerHasPhone relationship
Your result
Field Type Null Key Default Extra
customerid smallint unsigned NO PRI NULL autoincrement
storeid tinyint unsigned NO NULL
firstname varchar NO NULL
lastname varchar NO MUL NULL
email varchar YES NULL
addressid smallint unsigned NO MUL NULL
active tinyint NO
createdate datetime NO NULL
lastupdate timestamp YES CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES MUL NULL
Expected result
Field Type Null Key Default Extra
customerid smallint unsigned NO PRI NULL autoincrement
storeid tinyint unsigned NO NULL
firstname varchar NO NULL
lastname varchar NO MUL NULL
email varchar YES NULL
addressid smallint unsigned NO MUL NULL
active tinyint NO
createdate datetime NO NULL
lastupdate timestamp YES CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES UNI NULL
:Implement StaffHasPhone relationship
Your result
Field Type Null Key Default Extra
staffid tinyint unsigned NO PRI NULL autoincrement
firstname varchar NO NULL
lastname varchar NO NULL
addressid smallint unsigned NO MUL NULL
picture blob YES NULL
email varchar YES NULL
storeid tinyint unsigned NO MUL NULL
active tinyint NO
username varchar NO NULL
password varchar YES NULL
lastupdate timestamp NO CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES MUL NULL
Expected result
Field Type Null Key Default Extra
staffid tinyint unsigned NO PRI NULL autoincrement
firstname varchar NO NULL
lastname varchar NO NULL
addressid smallint unsigned NO MUL NULL
picture blob YES NULL
email varchar YES NULL
storeid tinyint unsigned NO MUL NULL
active tinyint NO
username varchar NO NULL
password varchar YES NULL
lastupdate timestamp NO CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES UNI NULL
:Implement StoreHasPhone relationship
Your result
Field Type Null Key Default Extra
storeid tinyint unsigned NO PRI NULL autoincrement
managerstaffid tinyint unsigned NO UNI NULL
addressid smallint unsigned NO NULL
lastupdate timestamp NO CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES MUL NULL
Expected result
Field Type Null Key Default Extra
storeid tinyint unsigned NO PRI NULL autoincrement
managerstaffid tinyint unsigned NO UNI NULL
addressid smallint unsigned NO NULL
lastupdate timestamp NO CURRENTTIMESTAMP DEFAULTGENERATED on update CURRENTTIMESTAMP
phoneid int YES UNI NULL
:Implement foreign key rules for customer table
Your result
UPDATERULE DELETERULE COLUMNNAME REFERENCEDTABLENAME
CASCADE SET NULL phoneid phone
:Implement foreign key rules for staff table
Your result
UPDATERULE DELETERULE COLUMNNAME REFERENCEDTABLENAME
CASCADE SET NULL phoneid phone
:Implement foreign key rules for store table
Your result
UPDATERULE DELETERULE COLUMNNAME REFERENCEDTABLENAME
CASCADE SET NULL phoneid phone
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