SELECT *
and Hello WorldWHERE
filters and basic SQL functionsSUM()
, COUNT(*)
, etcORDER BY
COUNT(DISTINCT ...)
GROUP BY
JOIN
sWrite a query that returns the first name, last name, and hire date of every female manager. For this problem, an employee is defined as a manager if the employee existing in the dept_manager
table. Write this query using common table expressions (CTEs). (Hint: Use dept_manager
and employees
tables.)
Repeat question 1 and get the same output, but write the query using no subqueries, just JOINs.
Write a query that returns the first name, last name, and salary of every level of engineer (e.g. Engineer, Senior Engineer, etc) who was hired after 1970. If an employee has multiple salary records, return the highest salary. Write this query using common table expressions (CTEs). (Hint: Use titles
, salaries
, employees
tables.)
Repeat question 3 and get the same output, but write the query using no subqueries, just JOINs.
Write a query that returns the first name, last name, and hire date of every employee who has worked in the Marketing department who makes more than $30k in salary. Write this query using common table expressions (CTEs). (Hint: Use dept_emp
and salaries
tables.)
Repeat question 5, but write the query using no subqueries, just JOINs.
Sample Solutions for Problem Set #8