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?

  1. 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;

  2. 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;

  3. 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;

  4. D.

    None of the above

Attempted by 120 students.

Sign up free to check your answer

Sign up free

Explore the full course: Isro

Loading lesson…