Let's try to understand joins by trying to verbalize what 'question' each join is trying to answer.
We will try to frame the explanation in terms of a real world example. We will build a Jobs DB
with two tables - job and candidate. The job table will have a city
field representing where the job location is at. Similarly candidate
table also has a city
field representing the city which the candidate prefers. Our goal is to match candidates to jobs based on the city. We will try to answer different questions with different joins and subqueries.
This seemed like a better example than other examples based on primary keys because this particular example does the matching on a column which can allow duplicate values. So we can understand the general case of how joins work. The case where the join is on a primary key column or a col with unique constraint - will just be a special case of this general case.