If I wanted to find out customer details from the customer table to find out who has not placed an order do you know what the SQL Script would be like? Trying to link but no luck so far.
--One more alternate By this approach you can select all columns in both tables SELECT c.* FROM customers c LEFT JOIN Orders o ON o.custid = c.custid WHERE o.custid IS NULL
Note: As per ahmeds08's solution, If you have NULL value for custid in Orders Table, then it won't give any single record (even we have non-order customers)...... For that solution is NOT IN ( SELECT Custid FROM Orders WHERE custid IS NOT NULL)
--One more alternate By this approach you can select all columns in both tables SELECT c.* FROM customers c LEFT JOIN Orders o ON o.custid = c.custid WHERE o.custid IS NULL
Note: As per ahmeds08's solution, If you have NULL value for custid in Orders Table, then it won't give any single record (even we have non-order customers)...... For that solution is NOT IN ( SELECT Custid FROM Orders WHERE custid IS NOT NULL)
--One more alternate By this approach you can select all columns in both tables SELECT c.* FROM customers c LEFT JOIN Orders o ON o.custid = c.custid WHERE o.custid IS NULL
Note: As per ahmeds08's solution, If you have NULL value for custid in Orders Table, then it won't give any single record (even we have non-order customers)...... For that solution is NOT IN ( SELECT Custid FROM Orders WHERE custid IS NOT NULL)