Left Join To Fetch Records Not Present in Other Table

Published on Author bloggerfive

Employee table have details about all employee like employee name,their role,address and etc.

In other table, Medical Claim table have the record of employee’s who are taken medical claims.
As it is not mandatory, only few employee have applied for medical claim.

The scenario is, we need to fetch the record of employees who have not applied for medical claim

Here, employee_id is the primary key

FROM Employee  a
LEFT JOIN Medical_Claim b
ON a.employee_id = b.employee_id
WHERE b.employee_id IS NULL;

Good luck !