Your SlideShare is downloading. ×
0
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Joins in m ysql
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
388
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Disclaimer: This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .Ltd
  • 2. JOIN IN MYSQL Atheendrh Email: atheendrh@gmail.com Faebook id : atheendrhk@gmal.com
  • 3. JOIN• The JOIN keyword is used in an MYSQL statement to query data from two or more tables, based on a relationship between certain columns in these tables.• Tables in a database are often related to each other with keys.• A primary key is a column (or a combination of columns) with a unique value for each row. Each primary key value must be unique within the table. The purpose is to bind data together, across tables, without repeating all of the data in every table.
  • 4. • Note that the "P_Id" column is the primary key in the "Persons" table. This means that no two rows can have the same P_Id. The P_Id distinguishes two persons even if they have the same name.
  • 5. • Note that the "O_Id" column is the primary key in the "Orders" table and that the "P_Id" column refers to the persons in the "Persons" table without using their names.
  • 6. Different MYSQL JOINsBefore we continue with examples, we will list the typesof JOIN you can use, and the differences between them.• 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
  • 7. INNER JOIN• INNER JOIN: Return rows when there is at least one match in both tables •The INNER JOIN keyword returns rows when there is at least one match in both tables. If there are rows in "Persons" that do not have matches in "Orders", those rows will NOT be listed.
  • 8. LEFT JOIN• The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2).• The LEFT JOIN keyword returns all the rows from the left table (Persons), even if there are no matches in the right table (Orders).
  • 9. RIGHT JOIN• The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left table (table_name1).• The RIGHT JOIN keyword returns all the rows from the right table (Orders), even if there are no matches in the left table (Persons).
  • 10. FULL JOIN• The FULL JOIN keyword return rows when there is a match in one of the tables.• The FULL JOIN keyword returns all the rows from the left table (Persons), and all the rows from the right table (Orders). If there are rows in "Persons" that do not have matches in "Orders", or if there are rows in "Orders" that do not have matches in "Persons", those rows will be listed as well.
  • 11. 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
  • 12. Contact Us

×