Instagram
youtube
Facebook
Twitter

Join Products with Suppliers to Retrieve Supplier Names

Join Products with Suppliers to Retrieve Supplier Names

products Table:

suppliers Table:

Query Explanation:
SELECT Products.ProductName, Suppliers.SupplierName – Retrieves the product name and its corresponding   supplier name.
FROM Products – Data will be fetched from the Products table.
INNER JOIN Suppliers ON Products.SupplierID = Suppliers.SupplierID – Combines the Products and Suppliers tables using a common SupplierID, so we can get the matching supplier for each product.

 

SQL Query:

USE SalesInventoryDB;

SELECT products.ProductName,suppliers.SupplierName FROM products
inner join suppliers on products.SupplierID=suppliers.SupplierID;

 

Output: