MySQL: Will you write the code in MySQL using the instructions I provided? Create a table named cityState with the following attributes, data types, and constraints: a. city, variable character, 90 characters, not null b. state, character, 2 characters, not null c. zipCode, character, 5 characters, not null, unique d. primary key is the zipCode field Insert into table cityState data from file cityState.sql Alter table employee so that column zipCode is a foreign key to table cityState, column zipCode Alter table customer so that column zipCode is a foreign key to table cityState, column zipCode Create view customerView with a join query to join tables customer and cityState to do the following: a. Select column firstName from table customer b. Select column lastname from table customer c. Select column address from table customer d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table customer g. Select column phone from table customer h. Select column email from table customer Create view employeeView with a join query to join tables employee and cityState to do the following: a. Select column firstName from table employee b. Select column lastname from table employee c. Select column address from table employee d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table employee g. Select column phone from table employee h. Select column email from table employee Create a table named sale with the following attributes, data types, and constraints: a. employeeId, int, not null b. customerId, int, not null c. vehicleId, int, not null d. salePrice, decimal, 8 characters total, 2 characters to the right of the decimal point, not null e. primary key is fields employeeId, customerId, and vehicleId f. foreign key on field employeeId, references table employee, column id g. foreign key on field customerId, references table customer, column id h. foreign key on field vehicleId, references table vehicle, column id
MySQL:
Will you write the code in MySQL using the instructions I provided?
Create a table named cityState with the following attributes, data types, and constraints: a. city, variable character, 90 characters, not null b. state, character, 2 characters, not null c. zipCode, character, 5 characters, not null, unique d. primary key is the zipCode field |
Insert into table cityState data from file cityState.sql |
Alter table employee so that column zipCode is a foreign key to table cityState, column zipCode |
Alter table customer so that column zipCode is a foreign key to table cityState, column zipCode |
Create view customerView with a join query to join tables customer and cityState to do the following: a. Select column firstName from table customer b. Select column lastname from table customer c. Select column address from table customer d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table customer g. Select column phone from table customer h. Select column email from table customer |
Create view employeeView with a join query to join tables employee and cityState to do the following: a. Select column firstName from table employee b. Select column lastname from table employee c. Select column address from table employee d. Select column city from table cityState e. Select column state from table cityState f. Select column zipCode from table employee g. Select column phone from table employee h. Select column email from table employee |
Create a table named sale with the following attributes, data types, and constraints: a. employeeId, int, not null b. customerId, int, not null c. vehicleId, int, not null d. salePrice, decimal, 8 characters total, 2 characters to the right of the decimal point, not null e. primary key is fields employeeId, customerId, and vehicleId f. foreign key on field employeeId, references table employee, column id g. foreign key on field customerId, references table customer, column id h. foreign key on field vehicleId, references table vehicle, column id |
I will rate the work if all my questions are answered. Thanks!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps