I was doing an exercise and I am stuck on it. There are 2 tables:
- Customers(id, firstname, lastname, address)
- Orders (id, product_name, product_price, date_order DATE, id_customer, amount)
The query:
SELECT Orders.product_name, Customers.firstname, Customers.lastname
FROM Orders INNER JOIN
Customers
ON Orders.id_customer=Customers.id
ORDER BY Orders.id;
Expected result:
Show the list of all products' names ordered along with first and last names of the customers.
Include in the result only those customers who have no address in a database and sort the data by Orders.id
.