Resolved: JOIN and WHERE Used Together
By watching the lesson, I tried to write the query before it was shown on the screen,
both left join and inner join will do the same, so which times I have to use only left join and which times for inner join....
1 answers ( 1 marked as helpful)
Hi Abdulrahman!
Thanks for reaching out.
Use a Left Join when you need to include all records from the left table (the first table in the JOIN clause), regardless of whether there are matching entries in the right table. This allows you to see which rows have a match in the right table and which do not.
Use an Inner Join when you only want to include records where there is a match found in both tables. This is useful when you only need rows that have corresponding data in both tables.
Basically, choose based on whether you need to retain all records from one table (LEFT JOIN) or only the records that have matching parts in both tables (INNER JOIN).
Hope this helps.
Best,
Tsvetelin
Thanks for reaching out.
Use a Left Join when you need to include all records from the left table (the first table in the JOIN clause), regardless of whether there are matching entries in the right table. This allows you to see which rows have a match in the right table and which do not.
Use an Inner Join when you only want to include records where there is a match found in both tables. This is useful when you only need rows that have corresponding data in both tables.
Basically, choose based on whether you need to retain all records from one table (LEFT JOIN) or only the records that have matching parts in both tables (INNER JOIN).
Hope this helps.
Best,
Tsvetelin