I don't remember when I last touched databases before today. It must be in my college days. These days almost every software system is built on a database. So I thought why not to refurbish my owns knowledge. So today I have picked up a very important terminology from Database world, "Join".
There are 3 kinds of joins as;
Let's say we have 2 tables as;
Customer(Cno, Cname, Address);
Order(Tid, description, amount, Cno);
So the query can be written in format as;
Select <<Column names>> from <<Table name1>> <<Join type>> <<Table name2>> ON <<table name.column>> = = <<table name2.column>>
These 3 types of joins can be summarized as,
There are 3 kinds of joins as;
- Join
- Left Join
- Right Join
Let's say we have 2 tables as;
Customer(Cno, Cname, Address);
Order(Tid, description, amount, Cno);
So the query can be written in format as;
Select <<Column names>> from <<Table name1>> <<Join type>> <<Table name2>> ON <<table name.column>> = = <<table name2.column>>
These 3 types of joins can be summarized as,
- Join returns records from both the tables if at-least one condition is matching.
- Left join returns records from the left table even if no condition is matching.
- Right join returns records from the right table even if no condition is matching.