Consider two relational schemas Project (Pnumber, Pname, Dno) and…
Consider two relational schemas Project (Pnumber, Pname, Dno) and works_on(eid, pno, hours) with primary keys as underlined. Choose an SQL query to retrieve all project numbers in descending order in which more than 3 employees are working?
- A.
SELECT W.Pno, count(*) as No_employees_working FROM Project P, Works_on W ON W.pno= P. Pnumber GROUP BY eid HAVING Count(*) >3 ORDER BY Pno DESC;
- B.
SELECT W.Pno, count(*) as No_employees_working FROM Project P, Works_on W ON W.pno= P. Pnumber GROUP BY Pno HAVING Count(*) >3 ORDER BY Pno DESC;
- C.
SELECT W.Pno, count(*) as No_employees_working FROM Project P, Works_on W ON W.pno= P. Pnumber GROUP BY Pno, eid HAVING Count(*) >3 ORDER BY Pno DESC;
- D.
None of the above
Attempted by 120 students.
Sign up free to check your answer
Sign up freeLoading lesson…

