some queries implemented using the list monad
A special Table type instead of plain lists could provide an efficient implementation.
- employees :: [Emp]
- clerks :: [Emp]
- richClerks :: [Emp]
- researchers :: [Emp]
- researchers0 :: [Emp]
- managers :: [(String, String)]
- managers0 :: [(String, String)]
- realManagers :: [String]
- realManagersFull :: [Emp]
- realManagersSortedFull :: [Emp]
- maximumSalary :: Int
- richestEmployee :: Emp
- teams :: [(String, [String])]
- teams0 :: [(String, [String])]
- averageSalariesInDepartments :: [(String, Int)]
- managerOfLargestTeam :: (String, Int)
- teamSalaries0 :: [(String, Int)]
- teamSalaries :: [(String, Int)]
Documentation
richClerks :: [Emp]Source
all clerks with salary at least 1000
researchers :: [Emp]Source
all employees in research department
researchers0 :: [Emp]Source
managers :: [(String, String)]Source
names of all employees and their managers if the employee has a manager so far
managers0 :: [(String, String)]Source
names of all employees and their managers; if the employee has no manager, return an empty string
realManagers :: [String]Source
names of managers that have at least one employee
realManagersFull :: [Emp]Source
managers that have at least one employee
realManagersSortedFull :: [Emp]Source
managers that have at least one employee, sorted by their names.
maximum salary amongst all employees
employee with maximum salary without a back-join
averageSalariesInDepartments :: [(String, Int)]Source
average salary in each department
managerOfLargestTeam :: (String, Int)Source
manager with most employees
teamSalaries0 :: [(String, Int)]Source
A recursive query: Compute the total salary for each manager and the total set of employees he conducts.
teamSalaries :: [(String, Int)]Source