Monday, April 18, 2016

What is an inner join?


SQL Programming language Joins syntax  are join two or more tables. Most usable SQL join is INNER JOIN. It’s a most common join. This join check both table match with the condition. INNER JOIN possible more then two table, it can work with  multiple table. It’s join two or more table based on there matching field.

Example:

Stu_Info table name

StuId
Namesss
Class
1
Erfan
8
2
syeda
11
10
Hafiz
12

Stu_tuition  table name

StuId
Payment
Month
11
500
4
1
2000
8
2
3000
12

SQL INNER JOIN QUERY :

SELECT Stu_Info.StuId, Stu_Info.Namesss, Stu_tuition.Payment
FROM Stu_Info
INNER JOIN Stu_tuition
ON Stu_Info.StuId=Stu_tuition.StuId;


Output of the query  :


StuId
Namesss
Payment
1
Erfan
2000
2
syeda
3000

No comments:

Post a Comment