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

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter11: Sql Server Databases
Section: Chapter Questions
Problem 6E
icon
Related questions
Question

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!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Elements of Tables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning