SQL Joins with Example

.
 SQL Joins- Joins With Example
In this tutorial, we are going to learn joins in SQL with examples and Joins Type. 

Joins:
SQL Joins clause is used to combine data or rows from two or more tables, based on a related column between them.
"To retrieve the data from multiple tables we used Joins"

Syntax of Joins 
The basic syntax of joins is given below.

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

Types of SQL Joins
Different types of joins are as follows
  • SQL INNER JOIN (Simple Join) 
  • SQL LEFT OUTER JOIN (LEFT JOIN) 
  • SQL RIGHT OUTER JOIN (RIGHT JOIN) 
  • SQL FULL OUTER JOIN (FULL JOIN)

SQL INNER JOIN (Simple Join) 
The INNER JOIN keyword selects records that have matching values in both tables.

Syntax of Inner Join
Syntax of inner join given below.

SELECT table1.column1, table2.column2... FROM table1 INNER JOIN table2 ON table1.common_field = table2.common_field;



.

Post a Comment

0 Comments