---
title: "What is Joins in Database explain it with write example?"  
description: "What is Joins in Database explain it with write example?"  
author: "Ravi Vishwakarma"  
published: 2023-01-27  
updated: 2023-01-27  
canonical: https://www.mindstick.com/forum/157350/what-is-joins-in-database-explain-it-with-write-example  
category: "mssql server"  
tags: ["database", "sql server"]  
reading_time: 2 minutes  

---

# What is Joins in Database explain it with write example?

I have no [ideas](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas) about the Joins in Database. [Please explain](https://www.mindstick.com/forum/344/hi-rohith-i-am-new-for-mvc-please-explain-how-to-set-implicitly-isauthenticated-true) it with the write example.

## Replies

### Reply by Amrita Bhattacharjee

A join in a database refers to the combination of rows from two or more tables based on a related column between them. The result shows one table with columns from the joined tables.

**The types of joins in** [**SQL**](https://www.mindstick.com/articles/310848/what-is-sql-injection-sqli-how-to-prevent-it) **includes:**

- Inner Join: It is used to return only the rows whereas there exists a match in two tables.
- Left Outer Join: It is used to return all of the rows from the left table and the rows which are in match from the right table.
- Right Outer Join : It is used to return all of the rows from the right table and the rows which are matching from the left table.
- Full Outer Join: It is used to return all of the rows from both the tables, including the unmatched rows as well.

As an example,If we have have two tables including "Customers" and "Orders", with the following data:

## Customers table:

| ID | Name |
| --- | --- |
| 1 | John |
| 2 | Sarah |
| 3 | Mike |

## Orders table:

| ID | OrderID | CustomerID |
| --- | --- | --- |
| 1 | 1001 | 1 |
| 2 | 1002 | 2 |
| 3 | 1003 | 1 |

If we join these two tables on the "CustomerID" column then we will get the following result:

## Result of INNER JOIN:

| ID | Name | OrderID | CustomerID |
| --- | --- | --- | --- |
| 1 | John | 1001 | 1 |
| 1 | John | 1003 | 1 |
| 2 | Sarah | 1002 | 2 |


---

Original Source: https://www.mindstick.com/forum/157350/what-is-joins-in-database-explain-it-with-write-example

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
