Instagram
youtube
Facebook
Twitter

Retrieve Orders with Their Shipping Company Names

Retrieve Orders with Their Shipping Company Names

Order Table:

shippers Table:

Query Explanation:
SELECT Orders.OrderID, Shippers.ShipperName – Retrieves each order’s ID and the name of the shipping company.
FROM Orders – Data is being fetched from the Orders table.
INNER JOIN Shippers ON Orders.ShipperID = Shippers.ShipperID – Joins the Orders table with the Shippers table using the ShipperID to link each order with its corresponding shipping company.

 

SQL Query:

USE SalesInventoryDB;

select orders.OrderID,shippers.ShipperName from orders
inner join shippers on orders.ShipperID= shippers.ShipperID;

 

Output: