What is Join | SQl | developerIndian

All Articles

#what is join #joins in sql with examples #sql join examples,sql join #clause #combine two tables sql

What is Join | SQl | developerIndian

An SQL Join is used to combine data from two or more tables, based on a common
field between them.

For example, consider the following two tables.
Student Table

EnrollNo StudentName Address
1000 devleop1 quiz1
1001 develop2 quiz2
1002  develop3 quiz3

StudentCourse Table

CourseID EnrollNo
1 1000
2 1000
3 1000
1 1002
2 1003

Following is join query that shows names of students enrolled in different courseIDs.

SELECT StudentCourse.CourseID, Student.StudentName
FROM StudentCourse
INNER JOIN Customers
ON StudentCourse.EnrollNo = Student.EnrollNo
ORDER BY StudentCourse.CourseID;