Instagram
youtube
Facebook
Twitter

Get Suppliers with No Products Listed in SQL

Get Suppliers with No Products Listed in SQL

suppliers table:

products Table:

Query Explanation:

SELECT SupplierID, SupplierName
 Displays the ID and name of the suppliers.

FROM Suppliers
 Fetches data from the Suppliers table.

WHERE SupplierID NOT IN (SELECT SupplierID FROM Products)
 Filters out suppliers who have listed products. Only shows those whose SupplierID is not found in the Products table.

SQL Query:

USE SalesInventoryDB;

select * from suppliers
where SupplierID not in (select products.SupplierID from products);

 

Output: