-- DATABASE MANAGEMENT SYSTEMS 2020
-- LAB EXERCISE week 6 6
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-- Grouping
-- ~~~~~~~~~~~~~~~~~~~~
-- What is the sum of salaries paid by each branch?


-- How many clients does each branch have registered with them?


-- Find out how many properties are currently registered for the different property types and what the average price of renting them is.


-- List the staff number and number of properties managed by each member of staff.


-- Find out the number of properties being managed by members of staff who are currently managing over 4 properties.


-- Find out the number of viewings booked for all properties.



-- Subqueries
-- ~~~~~~~~~~~~~~~~~~~~

-- List all properties, showing property number, address and type, with rental prices less than the national average rental price and by how much they are less than this average.


-- List all properties, showing the property number, type, address and managed by, registered with Dream Home that have NEVER BEEN Rented.
-- Hint you will need to use NOT IN


-- How much has Branch, B0003, earned from renting properties?
-- Hint: You will need to refer to one of the queries from last week as well as use a subquery to find the properties for branch B0003


