Login
Remember
Register
Ask a Question
Write a basic SQL query that lists all orders with customer information.
0
votes
asked
Oct 1, 2021
in
Data Science
by
Robin
Write a basic SQL query that lists all orders with customer information.
sql-query
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Oct 1, 2021
by
Robin
Usually, we have order tables and customer tables that contain the following columns:
Order Table
Orderid
customerId
OrderNumber
TotalAmount
Customer Table
Id
FirstName
LastName
City
Country
The SQL query is:
SELECT OrderNumber, TotalAmount, FirstName, LastName, City, Country
FROM Order
JOIN Customer
ON Order.CustomerId = Customer.Id
...