Skip to content

DW BI MASTER

Just another WordPress site

Menu
  • Home
  • Sample Page
Menu

SQL Join

Posted on October 29, 2017
A SQL Join clause is used to combine rows from two or more tables, views, or materialized views based on a common field between them. A SQL join condition is used in the where clause of select, update, delete statements.

Syntax For Joining Two Table is :

SELECT col1, col2, col3…
FROM table_name1, table_name2
WHERE table_name1.col2 = table_name2.col1;

SQL Join Types :

There are different kinds of joins, which have different rules for the results they create. Listed below are the different types of  SQL join :

  1. Inner Join —- selects all rows from both tables as long as there is a match between the columns in both tables.
  2. Left Join – returns all rows from the left table, even if there are no matches in the right table.
  3. Right Join – returns all rows from the right table, even if there are no matches in the left table.
  4. Full Join – combines the result of both LEFT and RIGHT joins.
  5. Self Join – is used to join a table to itself as if the table were two tables, temporarily renaming at least one table in the SQL statement.
  6. Cartesian Join – returns the Cartesian product of the sets of records from the two or more joined tables.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Recent Posts

  • What is Machine Learning ?
  • What is Data Lake ?
  • What is Change Data Capture ?
  • Introduction to Data Mining
  • How to Create Free Tier AWS Account

Archives

  • July 2021
  • May 2018
  • January 2018
  • November 2017
  • October 2017
©2022 DW BI MASTER | Design: Newspaperly WordPress Theme