CBSE Class 12 Informatics Practices Question 83 of 90

Querying Using SQL — Question 23

Back to all questions
23
Question

Question 23

Below are the customer and order tables :

Customers

customer id (PK)
first_name
last_name
email
address
city
state
zip

Orders

order id (PK)
order_date
amount
customer_id (FK)

List the customers (name) and their orders' details.

Answer
SELECT c.first_name, c.last_name, o.order_id, o.order_date, o.amount
FROM Customers c, Orders o
WHERE c.customer_id = o.customer_id;