Welcome Back

Google icon Sign in with Google
OR
I agree to abide by Pharmadaily Terms of Service and its Privacy Policy

Create Account

Google icon Sign up with Google
OR
By signing up, you agree to our Terms of Service and Privacy Policy
Instagram
youtube
Facebook

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: