Last answered:

23 Sept 2024

Posted on:

19 Sept 2024

0

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)
Instructor
Posted on:

23 Sept 2024

0
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

Submit an answer