1. Get departments together with the average salaries of their employees: deptemp.(((Dept as d) join avg(d.employs.Emp.sal._VALUE) as avgSal) as deptAvgSal); deptemp.(Dept join avg(employs.Emp.sal._VALUE)); 2. Get name and department name for employees earning less than 2222 deptemp.(Emp where sal._VALUE < 2222).(name._VALUE, worksIn.Dept.dname._VALUE); 3. Get names of employees working for the department managed by Bert. deptemp.(Emp where (worksIn.Dept.boss.Emp.name._VALUE) = "Bert"). name._VALUE; 4. Get the name of Poe’s boss: deptemp.(Emp where name._VALUE = "Poe").worksIn.Dept.boss.Emp.name._VALUE; 5.Names and cities of employees working in the department managed by Bert: deptemp.(Dept where (boss.Emp.name._VALUE) = "Bert").employs.Emp. (name._VALUE, ((address.city._VALUE) union ("No address" where not exists(address)))); deptemp.(Dept where (boss.Emp.name._VALUE) = "Bert").employs.Emp. (name._VALUE as name, (((address.city._VALUE) union ("No address" where not exists(address)))) as city ) as empcity; 6.Get the minimal, average and maximal number of employees in departments: deptemp.(min(Dept.count(employs)), avg(Dept.count(employs)), max(Dept.count(employs)) ); 7. For each department get its name and the sum of salaries of employees being not bosses: deptemp.(((Dept as d) join ((sum(d.employs.Emp.sal._VALUE) - (d.boss.Emp.sal._VALUE)) as s )). (d.dname._VALUE, s)); 8.Is it true that each department employs an employee earning the same as his/her boss?: deptemp. forall (Dept as d) forany ((d.employs.Emp minus d.boss.Emp) as e) forany (e.sal as s) (s._VALUE = d.boss.Emp.sal._VALUE); 9. For each employee get the message containing his/her name and the percent of the annual budget of his/her department that is consumed by his/her monthly salary: deptemp. Emp . ("Employee " + name._VALUE + " consumes " + ((sal._VALUE * 12 * 100)/(worksIn.Dept.budget._VALUE)) + "% of the " + worksIn.Dept.dname._VALUE + " department budget.") as message; 10. Get cities hosting all departments: deptemp.(unique(deref(Dept.loc._VALUE)) as deptcity) where forall(deptemp.Dept)(deptcity in loc._VALUE); 11. For each interval , n = 0, 1000, 2000, 3000, ... get the message (string) containing the number of employees having the salary within this interval and the interval itself. Output messages should have proper grammatical forms. (((0 union 1000 union 2000 union 3000 union 4000 union 5000 ) as i) join (count(deptemp.Emp where sal._VALUE >= i and sal._VALUE < i+1000) as c) join ((("s" where c<>1) union ("" where c=1)) as n) join ((("s" where c=1) union ("" where c<>1)) as v)). ((c + " employee" + n + " earn"+ v +" between "+ i +" and " + (i+999)) as message); ==================================================