I have to know about joins mean when and where should to use
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Salman BegRank #284 · 8.8K reputationPosted Dec 1, 2016, 12:32 AM EST
Ananth GRank #1,176 · 1.5K reputationPosted Dec 1, 2016, 12:43 AM EST
The SQL Joins clause is used to combine records from two or more tables in a database. A JOIN is a means for combining fields from two tables by using values common to each.
Consider the following two tables, (a) CUSTOMERS table is as follows:
(b) Another table is ORDERS as follows:
Now, let us join these two tables in our SELECT statement as follows:
This would produce the following result:
Here, it is noticeable that the join is performed in the WHERE clause. Several operators can be used to join tables, such as =, <, >, <>, <=, >=, !=, BETWEEN, LIKE, and NOT; they can all be used to join tables. However, the most common operator is the equal symbol.
SQL Join Types:
There are different types of joins available in SQL:
INNER JOIN: returns rows when there is a match in both tables.
LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table.
RIGHT JOIN: returns all rows from the right table, even if there are no matches in the left table.
FULL JOIN: returns rows when there is a match in one of the tables.
SELF JOIN: is used to join a table to itself as if the table were two tables, temporarily renaming at least one table in the SQL statement.
CARTESIAN JOIN: returns the Cartesian product of the sets of records from the two or more joined tables.
Nitin SontakkeRank #264 · 9.6K reputationPosted Dec 1, 2016, 1:17 AM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Dec 1, 2016, 3:35 AM EST
Khaja MoizuddinRank #270 · 9.4K reputationPosted Dec 1, 2016, 6:29 AM EST