Question: Question 1: Simple Queries [25 Marks] Refer to the entity-relation scheme shown in page 4. Use the file DreamHome.db included in this assignment to test
![Question 1: Simple Queries [25 Marks] Refer to the entity-relation scheme](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6703f9b60cf98_7816703f9b5ea275.jpg)
Question 1: Simple Queries [25 Marks] Refer to the entity-relation scheme shown in page 4. Use the file DreamHome.db included in this assignment to test the queries. Answer the following questions using SQL to produce the view. Only the SQL query will attract marks, not the view. Also, you must include at the end of your query the primary and foreign keys (if any) used. Degree and cardinality of the resulting view, and one sentence explaining the content of the first tuple based on the attributes queried. a) Find the total number of Managers and the sum of their salaries. [5 marks] b) Find the minimum, maximum, and average staff salary. [5 marks] c) For each branch office with more than one member of staff, find the number of staff working in each branch and the sum of their salaries. [5 marks] d) Construct a list of all cities where there is either a branch office or a property. [5 marks] e) Construct a list of all cities where there is both a branch office and a property. [5 marks]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
