SQL | Two Approaches | With & Without using JOIN
Using JOIN\n\nSELECT s.name FROM SalesPerson s \n\tWHERE s.sales_id NOT IN (\n\t\tSELECT o.sales_id FROM Orders o LEFT JOIN Company c \n\t\t\tON c.com_id=o.com_
Using JOIN\n```\nSELECT s.name FROM SalesPerson s \n\tWHERE s.sales_id NOT IN (\n\t\tSELECT o.sales_id FROM Orders o LEFT JOIN Company c \n\t\t\tON c.com_id=o.com_id \n\t\tWHERE c.name="RED"\n\t);\n```\n\n\nWithout using JOIN-\n```\n SELECT name FROM SalesPerson \n\t WHERE sales_id NOT IN(\n\t\t SELECT sales_id FROM Orders WHERE com_id IN (\n\t\t\t\t SELECT com_id FROM Company WHERE name="RED" )\n\t );\n\n```\nPlease upvote if you found this useful :)
['MySQL']