0% found this document useful (0 votes)
6 views

SQL JOINS

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

SQL JOINS

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

SQL JOINS

PRESENTED BY
P. SUPRAJA
FROM BATCH-18
INTODUCTION

• A JOIN clause is used to


combine rows from two CustomerI OrderDat
OrderID
or more tables, based on a D e
10308 2 1996-09-18
related column between
10309 37 1996-09-19
them.
10310 77 1996-09-20
• Look at the orders table.
LOOK THE CUSTOMERS TABLE

CustomerID CustomerName ContactName Country


1 Alfreds Maria Anders Germany
Futterkiste
2 Ana Trujillo Ana Trujillo Mexico
Emparedados y
helados
3 Antonio Moreno Antonio Mexico
Taquería Moreno
DIFFERENT TYPES OF JOINS IN SQL

• INNER JOIN
• OUTER JOIN
1.Left outer join
2. Right Outer join
3.Full outer join
• CROSS JOIN
1.cartesian product
INNER JOIN

• The inner join keyword select records that have matching values in both
sides.
• Syntax:
 Select column_name(s) Table 1 Table 2

From table 1 INNER JOIN table 2


on table1.column_name = table2.column_name
• Note:
The inner join keyword returns only rows with a match in both tables,
Which means that if you have product with no category ID or with a
categoryID that is not present in the categories table ,that record would not
be returned in the result.

You might also like