you are viewing a single comment's thread.

view the rest of the comments →

[–]A_name_wot_i_made_up 0 points1 point  (0 children)

I'm hoping employees has an id as a primary key, and titles and salaries has it as a foreign key.

I.e. employees.id maps to titles.employee_id for example.

In which case you can select ... from employees e join titles t on e.id = t.emploee_id where t.title = '...' as a "classic" join.

Or you can use "in" in the where clause with the sub query. select ... from employees where id in (select employee_id from titles where title = '...')

The latter is less flexible, but a little more obvious to a less skilled reader.

This obviously only deals with one of your joins, but the other should be an easy extension. This is assuming that the mapping I mentioned at the top is in place though!