Kickstart 2020 with new opportunities! - hours only!Up to 80% off on all courses and bundles.-Close
Foreign keys
Multicolumn foreign keys
Updates and deletes


Cool! That's it. Now that we have the tables ready, let's try to query our database.


Select first_name and last_name of each employee together with the title of their current position. Use the ERD below to help you.

The employee, job_history and position tables


  • (a) you will need to use JOIN twice to join the three tables
  • (b) if you only want to retrieve the current position of each employee, remember that the filed end_data for that particular row in job_history will be NULL.


Stuck? Here's a hint!


SELECT e.first_name, e.last_name, p.title
FROM employee e INNER JOIN job_history j
ON = j.employee_id JOIN position p
ON j.position_id =
WHERE end_date IS NULL;