Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago, 4 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Write SQL query given schemaÂ
Emp (eno CHAR(5), ename VARCHAR(30), bdate DATE, title CHAR(2),salary DECIMAL(9,2), supereno CHAR(5), dno CHAR(5), PRIMARY KEY (eno)) Dept (dno CHAR(5), dname VARCHAR(40), mgreno CHAR(5), PRIMARY KEY (dno)) -- mgreno is the employee number of the manager of the department (may join with Emp) Proj (pno CHAR(5), pname VARCHAR(40), budget DECIMAL(9,2), dno CHAR(5), PRIMARY KEY (pno)) -- dno is the department that has the project (may join with Dept) WorksOn (eno CHAR(5), pno CHAR(5), resp VARCHAR(20), hours SMALLINT, PRIMARY KEY (eno,pno)) -- Use eno to join with Emp. Use pno to join with Proj.
Â
Write a SQL query that returns the department number (dno), department name (dname), project number (pno), project name (pname), sum of hours worked on the project as well as the number of employees working on the project. Only include records where the budget is greater than $140,000. Order by sum of hours worked descending.