(** MYSQL DBA Certification Training https://www.edureka.co/mysql-dba **)
This Edureka PPT on SQL Joins will discuss the various types of Joins used in SQL Server with examples. The following topics will be covered in this PPT:
Introduction to SQL
What are Joins?
Types of Joins
FAQs about Joins
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
12. TYPES OF
JOINS
LEFT JOIN
TheLEFTJOINortheLEFTOUTERJOIN returnsalltherecordsfromthelefttable
andalsothoserecordswhichsatisfyaconditionfromtherighttable.Also,for
therecordshavingnomatchingvaluesintherighttable,theoutputorthe
result-setwillcontaintheNULLvalues.
Syntax:
SELECT Table1.Column1,Table1.Column2,Table2.Column1,....
FROM Table1
LEFT JOIN Table2
ON Table1.MatchingColumnName = Table2.MatchingColumnName;
SELECT Table1.Column1,Table1.Column2,Table2.Column1,.... FROM Table1 LEFT JOIN Table2 ON Table1.MatchingColumnName = Table2.MatchingColumnName;
www.edureka.co/mysql-dba
14. TYPES OF
JOINS
RIGHT JOIN
TheRIGHTJOINortheRIGHTOUTERJOIN returnsalltherecordsfromtheright
tableandalsothoserecordswhichsatisfyaconditionfromthelefttable.Also,
fortherecordshavingnomatchingvaluesinthelefttable,theoutputorthe
result-setwillcontaintheNULLvalues.
Syntax:
SELECT Table1.Column1,Table1.Column2,Table2.Column1,....
FROM Table1
RIGHT JOIN Table2
ON Table1.MatchingColumnName = Table2.MatchingColumnName;
SELECT Table1.Column1,Table1.Column2,Table2.Column1,.... FROM Table1 RIGHT JOIN Table2 ON Table1.MatchingColumnName = Table2.MatchingColumnName;
www.edureka.co/mysql-dba
19. What is a Natural Join and in which situations
is a Natural Join used?
www.edureka.co/mysql-dba
20. What is a Natural Join and in which situations is a Natural
Join used?
www.edureka.co/mysql-dba
Output when you apply
INNER JOIN
Output when you apply
NATURAL JOIN
21. How to map many-to-many relationships
using joins?
www.edureka.co/mysql-dba
22. How to map many-to-many relationships using joins?
www.edureka.co/mysql-dba
Projects Technologies Projects_to_Technologies
2JOIN statements
24. What is a Hash Join?
www.edureka.co/mysql-dba
Hash Joins are also a type of joins which are used to join large tables or in an instance,
where the user wants most of the joined table rows.
The Hash Join algorithm is a two-step algorithm.
Build Phase Probe Phase
25. What is Self & Cross Join?
www.edureka.co/mysql-dba
26. What is Self & Cross Join?
www.edureka.co/mysql-dba
SELF JOIN in is a join of a table to itself. This implies that each row in a table is joined
with itself.
The CROSS JOIN is a type of join in which a join clause is applied to each row of a table to
every row of the other table. Also, when the WHERE condition is used, this type of JOIN
behaves as an INNER JOIN, and when the WHERE condition is not present, it behaves like a
CARTESIAN product..
Self Join
Cross Join
27. How to perform JOIN operation on three
tables?
www.edureka.co/mysql-dba
28. How to perform JOIN operation on three tables?
www.edureka.co/mysql-dba
To perform a JOIN operation on 3 tables, you
need to use 2 JOIN statements.