Answered step by step
Verified Expert Solution
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started