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

List Orders with Customer Names and Order Date

List Orders with Customer Names and Order Date

Order 
 Table:


Customer  Table:

Query Explanation:

  • SELECT Customers.CustomerName, Orders.OrderDate:
    This selects the customer's name and the order date to be shown in the result.

  • FROM Orders:
    You're starting from the Orders table (which has info about the orders).

  • JOIN Customers:
    You're joining the Customers table to get the names of the customers.

  • ON Orders.CustomerID = Customers.CustomerID:
    This connects the two tables using the common column CustomerID

    SQL Query:

    SELECT Customers.CustomerName, Orders.OrderDate
    FROM Orders
    JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
    


    Output: