/* ------------------------------------------------------------------------ */ /* Write and test the following queries ----------------------------------- */ /* ------------------------------------------------------------------------ */ /* DO NOT use aggregate functions like MIN() in the following queries. Also, avoid ORDER BY and LIMIT to determine minimum. For now, we are practicing using WHERE NOT EXISTS when calculating minimum. */ /* 1. Print all jobs (each only once) in alphabetical order. */ /* 2. List names of all employees together with the location where they work and wage (years since hiring). */ /* 3. Print the name of the department in which the president works. (Your query must not use a specific emp_id.) */ /* 4. Print jobs of employees who work in Chicago. (Avoid repetition. Your query must not use a specific dept_id.) */ /* 5. For each employee, list all his/her subordinates (those that have him/her as the superior). Use an outer join so that your list contains every employee, even those without subordinates. */ /* 6. Which departments are empty (have no employees)? */ /* 7. Find the lowest salary in New York. (Remember: no LIMIT, no MIN. Use NOT EXISTS.) */ /* 8. Find the longest serving employee in New York. (Remember: no LIMIT, no MIN. Use NOT EXISTS.) */ /* 9. Which departments employ only salesmen? */ /* 10. Which employees manage only clerks? (Interpretation: at least one clerk and only clerks.) */ /* 11. Which departments have an employee for every job in the database? (Your query must not rely on specific jobs in the given dataset.) */ /* 12. Print names, department names and salaries of all employees whose salary is greater than the lowest salary in department 20. */ /* 13. Print the name of a department (if one exists) such that every employee in that department has a lower salary than every employee in any other department.*/