Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

b. Why were these values considered important?

Answered: 1 week ago