Question: Please help. How do I reconstruct my orig. table with the views that I derived from it? Original table construction: CREATE TABLE employees( employee_id INT

Please help. How do I reconstruct my orig. table with the views that I derived from it?

Original table construction:

CREATE TABLE employees( employee_id INT PRIMARY KEY, first_name VARCHAR(40) NOT NULL, last_name VARCHAR(40) NOT NULL, city VARCHAR(20) NOT NULL, salary INT NOT NULL )

INSERT into employees values(1,'Jason','Star', 'San Jose', 28000) INSERT into employees values(2,'Jody','Robles', 'Austin', 20000) INSERT into employees values(3,'Brandy','Larrison', 'Dallas', 30000) INSERT into employees values(4,'Sam','Hue', 'San Jose', 50000) INSERT into employees values(5,'Deric','Bowers', 'Austin', 45000) INSERT into employees values(6,'Melvin','Mash','Dallas', 55000) INSERT into employees values(7,'Kellen','Moore','San Jose', 62000) INSERT into employees values(8,'Anthony','Peters', 'Austin', 70000) INSERT into employees values(9,'Mac','Martinez', 'Dallas', 46000) INSERT into employees values(10,'Star','Jones', 'San Jose', 90000) INSERT into employees values(11,'Abdullah','Martin', 'Austin', 55000) INSERT into employees values(12,'Salman','Karachi','Dallas', 80000)

Views that I need to reconstruct together:

CREATE OR ALTER VIEW employees_in_austin AS SELECT employee_id, first_name, last_name, city FROM employees where city = 'Austin';

CREATE OR ALTER VIEW salaries_in_austin AS SELECT employee_id, salary FROM employees where city = 'Austin'; SELECT * FROM salaries_in_austin;

CREATE OR ALTER VIEW employees_in_dallas AS SELECT employee_id, first_name, last_name, city FROM employees where city = 'Dallas';

CREATE OR ALTER VIEW salaries_in_dallas AS SELECT employee_id, salary FROM employees where city = 'Dallas'; SELECT * FROM salaries_in_dallas;

CREATE OR ALTER VIEW employees_in_san_jose AS SELECT employee_id, first_name, last_name, city FROM employees where city = 'San Jose';

CREATE OR ALTER VIEW salaries_in_san_jose AS SELECT employee_id, salary FROM employees where city = 'San Jose'; SELECT * FROM salaries_in_san_jose;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!