Posted by : Anwar Hossain
Category : Basic sql tutorial for Beginner

How to join two table in sql server

Dear viewer I will show to join two tables based on the relation of two tables. SQL Server join is performed using join keyword and using on keywords. Hear for example I have created two tables which are related to each other that means parent and child table relationship. The parent table name is Department and child table name is Employee .Hear ID is the primary key of Department table which is known as primary column .This DepId is also known as a foreign key for Employee table.

SQL Join example



Employee Table


SQL Join Syntex

SELECT column_name(s)
FROM table1
ON table1.column_name=table2.column_name;

SQL Statement

SELECT Department.DepartmentName,Employee.Name,
FROM Department
JOIN Employee
ON Department.ID = Employee.DepId

SQL Statement Result


Realted Article Headline

How to use MIN () Aggregate Function
How to use MAX () Aggregate Function
How to use SUM () aggregate function
how to use AVG () aggregate function
How to use sql alies for sql table
SQL BETWEEN Operators for retrieving range values
FULL OUTER JOIN using two tables in SQL server
LEFT JOIN using two tables in SQL server
How to join two table in sql server

Article Category

How to create control dynamically
Learn HTML for beginner
DataList example in C Sharp
Mail sending in c#
State Management in ASP C #
Basic sql tutorial for Beginner
DataTable example in ASP.Net C#
How to use LINQ in ASP.NET C# c # basic tutorial
How to use ajax toolkit in C#
How to use different types of validation control using c#
How to use grid view in c#
Protected by Copyscape Online Plagiarism Detection