Thursday, 9 March 2017

Joins (Inner Joins)


JOINS

Joins:

Joins are used to retrieve data from two or more tables based on logical relationship between the tables 

Types of Joins :

            I. Inner Joins 
           II. Outer Joins
         III. Self Joins
           IV. Cross Joins


Inner Joins :

In case of inner joins matched data from both the tables are included into the result set .

Syntax : left table name alias name1 inner join | join right alias name2 on <Condition>

I. Here we have two tables in database 

   

Resultant Set :

        

II.Query for Inner Joins Based on Conditions 

Resultant Set :


Note :
Here by the condition of join , Sid colum of tblStudent will be compared with the second table column S_id .  Sid will be compared with all the record of S_id ,
 if condition true then it will take the Tname  from tbltraining table  
        
  Hope you all understand the Joins and Inner Joins with simple Example  


  Do have any query regarding my code you can comment below !!! 


 .
     

No comments:

Post a Comment