Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Simple JOINs recap
6. JOIN and filtering
Various kinds of JOINs
Filtering with LEFT JOIN and RIGHT JOIN
Summary

Instruction

Good start! Of course, in JOIN queries we can use WHERE to filter results as in other queries.

SELECT
  full_name,
  name
FROM position
JOIN employee
  ON position.id = employee.position_id
WHERE employee.start_year > 2016

Here we select full name and position name of employees who were hired after 2016.

Exercise

Show the name of each author together with the title of the book they wrote and the year in which that book was published.

Show only books published after 2005.

Stuck? Here's a hint!

Type:

SELECT
  name,
  title,
  publish_year
FROM author
JOIN book
  ON author.id = book.author_id
WHERE publish_year > 2005