0% found this document useful (0 votes)
19 views5 pages

Exp 6

The document discusses different types of SQL joins including inner, left, right, and full outer joins. It provides the syntax for each type of join and describes what type of records each join returns.

Uploaded by

MINAL SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Exp 6

The document discusses different types of SQL joins including inner, left, right, and full outer joins. It provides the syntax for each type of join and describes what type of records each join returns.

Uploaded by

MINAL SINGH
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

EXPERMIMENT6

NAME=AKANKSHA
B.TECH CSIT A
BATCH=A2
ROLL NO=2100290119001

SQL JOIN
A JOIN clause is used to combine rows from two or more tables, based on a related column between
them.

1=INNER JOIN Returns records that have matching values in


both tables

we can create the SQL statement (that contains an INNER JOIN), that selects records that have matching values in
both tables:

SELECT Orders.Order_id, Customers.first_name, Orders.amount

FROM Orders

INNER JOIN Customers

ON Orders.Customer_id=Customers.Customer_id;
2=LEFT (OUTER) JOIN:
Returns all records from the left table, and the matched records from
the right table

SYNTAX
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name = table2.column_name;
3= RIGHT JOIN

syntax
SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name = table2.column_name;
4= FULL OUTER JOIN
Returns all records when there is a match in either left or right table

syntax
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name = table2.column_name
WHERE condition;

You might also like