• LOGIN
    • No products in the cart.

Learn About SQL Joins

What is SQL?

Structured Query Language (“SEQUEL) was developed by IBM Corporation Inc. SQL is an ANSI and ISO standard computer language for accessing, manipulating and controlling data’s in database systems. It is a structured query language, it is used to interact with databases. It is not a programming language. It is not case sensitive. It is a common language to use for all the databases. It works with database programs like ORACLE, MS SQL Server, My SQL, Teradata, MS Access, DB2, Informix, Sybase, etc.,

Defining Joins:

When data from more than one table in the database is required, a join condition is used. Rows in one table can be joined to rows in another table according to common values existing in corresponding columns, that is, usually primary and foreign key columns. If a row does not satisfy a join condition, the row will not appear in the query. If two tables have a column name in common, you must qualify all references to these columns throughout the query with its table names to avoid ambiguity.

Learn About SQL Joins

Inner Join:

When we join two tables or datasets together on equality (i.e. column or set of columns) we are performing an inner join.

Example:

Learn About SQL Joins

Left Outer Join:

Left outer join produces the results, which contains all the rows from left table and matched rows from the right table.

Example:

Learn About SQL Joins

Right Outer Join:

Right outer join produces the result set, which contains all the rows from right table and matched rows from the left table.

Example:

Learn About SQL Joins

Full Outer Join:

Full outer join produces the result set, which contains all the rows from left table and all the rows from the right table.

Example:

There are few more joins which you can know:

Natural Join:

A natural join will join two data sets on all matching column names, regardless of whether the columns are actually related in anything other than name.

Cross Join:

A join without having any condition is known as cross join, in cross join every row in first table is joins with every row in the second table. Cross join is nothing but cartesian product.

Self Join:

A self join is a join which a table is joined with itself.

August 24, 2017

0 responses on "Learn About SQL Joins"

Leave a Message

Tek Classes © Databi Solutions Pvt Ltd, 2014 - 2017.All rights reserved.
X