Views
7. Querying your own view
Revision

Instruction

Good! Now it's time to challenge your brand-new view.

Exercise

Use a join to select first_name and last_name of current_lecturer together with their current position title. Use the diagram below to help you get around the tables:

Database with view current_lecturer

Stuck? Here's a hint!

Type:

SELECT l.first_name, l.last_name, p.title 
FROM current_lecturer l 
INNER JOIN job_history j on j.lecturer_id = l.id 
JOIN position p
  ON j.position_id = p.id
WHERE end_date IS NULL;

Console

Code editor

Result

TableConsole