i.e. selecting all the columns from table1 & table 2 to perform an inner join on the condn that name col of table1 = ID col of table2
Look at the following explanation for the above query performed for more clarity:-
See Image
βοΈ Left Join
Using LEFT JOIN, the query returns all the rows from the left table and only those rows from the right table where the join condition is matched.
Query: select tablename1.col1, tablename2.col2 from tablename1 LEFT JOIN tablename2 ON tablename1.col1 = tablename2.col2
Example: Consider the same 2 tables we considered for the inner join.
Notice that the left table, i.e. the table 1, is entirely printed, and only those values of table 2 (the right side table) are printed where the join condition is met.
βοΈ Right Join
It functions similar to the left join, but the only difference is that it returns all the rows from the RIGHT table and only those rows from the left table where the join condition is matched.
Query: select * from tablename1 RIGHT JOIN tablename2 ON tablename1.col1 = tablename2.col2
Try to implement this one yourself. :)
βοΈ Full Join
It returns all rows when there is a match in either the left or the right table.
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh