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 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. pts Use the information I provided below please
CREATE TABLE project
pronum INT,
proname VARCHAR NOT NULL,
prolocation VARCHAR
prodeptnum INT,
PRIMARY KEY pronum
FOREIGN KEY prodeptnum REFERENCES departmentdptno;
CREATE TABLE assignment
workempssn CHAR
workpronum INT,
workhours INT,
workhoursplanned INT,
CONSTRAINT pkassignment PRIMARY KEY workempssn workpronum
CONSTRAINT fkworkemp FOREIGN KEY workempssn REFERENCES employeeempssn
CONSTRAINT fkworkpronum FOREIGN KEY workpronum REFERENCES projectpronum;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
