16

Joins and different types of joins dani

Embed Size (px)

Citation preview

Page 1: Joins and different types of joins dani
Page 2: Joins and different types of joins dani

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd

Page 3: Joins and different types of joins dani

JOINS AND DIFFERENT TYPES OF JOINS

Mohammed [email protected]/dani3250twitter.com/DANI3250in.linkedin.com/in/

mohammeddanish9895825222

Page 4: Joins and different types of joins dani

Joins

• SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables.

Page 5: Joins and different types of joins dani

Different SQL Joins

• JOIN: Return rows when there is at least one match in both tables

• LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table

• RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table

• FULL JOIN: Return rows when there is a match in one of the tables

Page 6: Joins and different types of joins dani

SQL INNER JOIN Syntax

• SELECT column_name(s)FROM table_name1INNER JOIN table_name2ON table_name1.column_name=table_name2.column_name

INNER JOIN is the same as JOIN

Page 7: Joins and different types of joins dani

Example

Page 8: Joins and different types of joins dani

SQL LEFT JOIN

• The LEFT JOIN returns all rows from the left table(table_name1),even if there are no matches in the right table(table_name2)

Page 9: Joins and different types of joins dani

Example

Page 10: Joins and different types of joins dani

SQL RIGHT JOIN

• The RIGHT JOIN return all rows from the right table(table_name2),even if there are no matches in the left table(table_name1).

Page 11: Joins and different types of joins dani
Page 12: Joins and different types of joins dani

SQL FULL JOIN

• The FULL JOIN returns rows when there is a match in one of the tables

Page 13: Joins and different types of joins dani

Example

Page 14: Joins and different types of joins dani

If this presentation helped you, please visit our page facebook.com/baabtra and like it.

Thanks in advance.

www.baabtra.com | www.massbaab.com |www.baabte.com

Page 15: Joins and different types of joins dani

Contact Us

Emarald Mall (Big Bazar Building)Mavoor Road, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

NC Complex, Near Bus StandMukkam, Kozhikode,Kerala, India.Ph: + 91 – 495 40 25 550

Start up VillageEranakulam,Kerala, India.

Email: [email protected]

Page 16: Joins and different types of joins dani

THANKS