SQL Inner Join
January 7, 2023 2023-01-07 20:48SQL Inner Join
JOIN clause is used to combine rows from two or more tables, based on a related column between them.
INNER JOIN clause in SQL Server creates a new table (not physical) by combining rows that have matching values in two or more tables.

Below are the two tables Student and Department. Both of the tables are related with the DepartmentId.


Now, if we want to see the department names of each students, we can do an Inner Join to do that as follows:
SELECT STUDENT.FirstName, STUDENT.LastName, DEPARTMENT.DepartmentName
FROM STUDENT JOIN DEPARTMENT
ON STUDENT.DepartmentId = DEPARTMENT.DepartmentId
The above query will display the following result.

So in the above result we can get the department names of each students.
Please comment and share if you like this post and tell us about how we can enhance our posts. Thanks.
Subhajit
This is Subhajit Sinha, with more than 8 years of experience as a full stack developer in renowned Multinational Companies, here in this portal as an online tutor I will guide you personally to level up your programming skills and also will coach you to augment your career and salary as well.
Search
Popular posts

Comments (2)
Mohamed Jabati
I love sql
Subhajit
That’s great
Comments are closed.