/* ------------------------------------------------------------------------ */ /* Do not edit this part ---------------------------------------------------*/ /* ------------------------------------------------------------------------ */ :- consult('emp.pl'). :- consult('query.pl'). % emp(Employee Number, Name, Job, Superior, Employed from, Salary, Department Number) % dept(Department Number, Name, Location) /* ------------------------------------------------------------------------ */ /* Write and test the following queries ----------------------------------- */ /* ------------------------------------------------------------------------ */ /* 1. List names and jobs of all employees. */ /* 2. List names and jobs of employees with salary at least 2000. */ /* 3. Print names of employees who were hired between 1995 and 1998. */ /* 4. Print names and salaries of all managers and analysts. */ /* 5. Print the name of the department in which the president works. */ /* 6. Print jobs of employees who work in Chicago. */ /* 7. For each employee, print a list of all coworkers, that is, list all tuples [Employee name, Locations, Coworker]. */ /* 8. Print names of employees together with names of their managers. */ /* 9. Find the lowest salary in New York. */ /* 10. Print names, department names and salaries of all employees whose salary is greater than the lowest salary in department 20. */ /* Check whether all the rules you have used so far are safe. */ /* 11. Which departments contain all job positions? */ /* 12. Which departments are empty (have no employees)? */ /* 13. Which employees manage only clerks? */ /* 14. Which departments employ no salesmen? */ /* 15. Find names of all employees who are subordinates of Blake (both direct and indirect). */ /* 16. Determine if there are two employees having the same wage. */ /* Check whether all the rules you have used are safe. */