What are the types of join and explain each?

Joins are of two types:

1. Inner Join  – Matching column is given based on which joining the two tables occurs. all the rows which have a matching value of the column selected will be extracted. This is just like Intersection in sets. First find out all the matching values for the column selected for inner join, then return all the rows for this matching values.

2. Outer Join – Outer join is again divided into 3 types:

i Left Outer Join
ii Right Outer Join
iii Full Outer Join

In Left Outer join, unmatched column values for the first table are also extracted.

In right outer join, unmatched column values for the second table and matched column values for both the tables are extracted.

In full join, all the columns irrespective of matches are extracted.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: