How do you really explain when someone ask you about SQL Joins

How do you really explain when someone ask you about SQL Joins 1

Usually when a you are sitting inside an interview room and interviewer ask “Do you know SQL Joins in database?” Or, “How many types of joins do you know?”.

What is your first response?

Blank (no reply)?

Some people says “Inner join”, “Left Join”, “Right Join” etc.

Are these answers perfect?

Simply a big “NO”

When interviewer says to describe them. They generally started telling the definitions. Let me tell you very frankly, nobody cares about your definitions. They simple wanted to check, Are you able to explain then well or not?

Let me tell you the simplest and concrete answer:

Two types are joins are exist in SQL as given below:

  • Inner Join
  • Outer Join
    • Left Outer Join
    • Right Outer Join
    • Full Join

 

Now let’s understand the concept of SQL Join using set theory. Let have two tables A and B

How do you really explain when someone ask you about SQL Joins 2

Apart from this, We have one more Join, i.e., Self Join that is used in same table only. Means You are joining Table A with Table A on certain parameters.

I hope this concept will let you explain well in front of others. Cheers!