• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Data Science by
Q:
Write a basic SQL query that lists all orders with customer information.

1 Answer

0 votes
by

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

Related questions

0 votes
asked Feb 10, 2020 in Big Data | Hadoop by miceperry
+1 vote
asked May 27, 2019 in Data Handling by tempuser
...