Question: I need help with this sql problem.Write a query to display projects that have the difference between hours planned and hours worked is more than

I need help with this sql problem.Write a query to display projects that have the difference between hours planned and hours worked is more than 10. Display five columns. List the project number and name with a dash in between, name the column as Project, the total hours planned as Hours Planned, the total hours worked as Hours Worked, the difference, and the number of employees worked in each project. Sort the results in descending order by the difference. See sample output below. Your output must match the sample output. (25 pts) Use the information I provided below please
CREATE TABLE project (
pro_num INT,
pro_name VARCHAR(25) NOT NULL,
pro_location VARCHAR(25),
pro_dept_num INT,
PRIMARY KEY (pro_num),
FOREIGN KEY (pro_dept_num) REFERENCES department(dpt_no));
CREATE TABLE assignment (
work_emp_ssn CHAR(9),
work_pro_num INT,
work_hours INT,
work_hours_planned INT,
CONSTRAINT pk_assignment PRIMARY KEY (work_emp_ssn, work_pro_num),
CONSTRAINT fk_work_emp FOREIGN KEY (work_emp_ssn) REFERENCES employee(emp_ssn),
CONSTRAINT fk_work_pro_num FOREIGN KEY (work_pro_num) REFERENCES project(pro_num));

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!