Gce Model Questions Vol1 2021 Computer Studies Question 5
Practice objective / multiple choice question 5 from the 2021 Gce Model Questions Vol1 Computer Studies examination.
Given the tables below:\n\nEmployees(EmpID, DeptID, Salary)\n\n| EmpID | DeptID | Salary |\n|------|--------|--------|\n| 1 | 10 | 5000 |\n| 2 | 10 | 6000 |\n| 3 | 20 | 5500 |\n| 4 | 20 | 4500 |\n| 5 | 30 | 7000 |\n\nDepartments(DeptID, ManagerID)\n\n| DeptID | ManagerID |\n|--------|-----------|\n| 10 | 1 |\n| 20 | 3 |\n| 30 | 5 |\n\nConsider the SQL query:\n\n```sql\nSELECT d.DeptID\nFROM Departments d\nWHERE d.ManagerID IN (\n SELECT e.EmpID\n FROM Employees e\n WHERE e.Salary > (\n SELECT AVG(Salary)\n FROM Employees\n WHERE DeptID = d.DeptID\n )\n)\nGROUP BY d.DeptID\nHAVING COUNT(*) = 1;\n```\n\nWhich DeptID(s) are returned by this query?
Answer Options
About This Question
This is Gce Model Questions Vol1 2021 Computer Studies Question 5. It is one of the objective questions from the 2021 Gce Model Questions Vol1 Computer Studies examination.
Difficulty level: Hard .
Master the Exam!
You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.