01.SQL JOIN

SQL JOIN




01.Left Join

All the data in left table + matching data from other table.

All the data in the left table will be displayed irrespectively if it has matching entry or it does not have matching entry on the other table.

SELECT * FROM school sc LEFT JOIN student st ON sc.school_Id = st. school_Id;





02.Right Join

All the data in right table + matching  data from other table.

All the data in the right table will be displayed irrespectively if it has matching entry or it does not have matching entry on the other table.

 

SELECT * FROM school sc RIGHT JOIN student st ON sc.school_Id = st. school_Id;

 




03.Inner Join

Common data from both table.

Where data is matching in these two table on those record will be displayed.

SELECT * FROM school sc INNER JOIN student st ON sc.school_Id = st. school_Id;

 




04.Full Outer Join

All the data from both tables.

SELECT * FROM school sc FULL OUTER JOIN  student st ON sc.school_Id = st. school_Id;





Comments

Popular posts from this blog

02. Spring – Creating spring project clone it with GIT step by step.

02.What is MicroService?

06.Mongo DB - Query part 2 (Aggregation)