When joining tables, you'll sometimes find that they share a few column names. For example, it is common for tables to have an
id column. In this case, if two or more tables you're joining share some column names, you must always refer to those identical column names using the table name followed by a dot and the name of the column you want to select.
employee.id as employee_id,
position.id as position_id
ON position.id = employee.position_id
SELECT clause we specify the columns as
position.id to avoid ambiguity. If we don't do that, the database won't know which
id column we are referring to.
We also aliased the columns to
position_id, respectively, to make the result more readable.