Thursday 3 May 2018

What are the different types of joins in SQL?

Purpose:
  • This is another idiot test to see if someone has any SQL experience.
  • Not being to answer this question would be a worry.

Potential Answer:
In the very least a candidate should be able to differentiate between an inner and outer join:

The inner join is just a join = rows that match the join predicate from both tables.
And outer join will include all rows, even if the join predicate is not satisfied. If we have a left outer join, the table on the left hand side will always have a row in the result that, for each row it contains, even if there is no match in the right table.

You can shut down this path of questioning by referring to less common joins like:
Left Outer, Semi Join, Full outer join, Right outer join, Semi Outer join etc...

No comments:

Post a Comment