Challenge: List All Customers and Their Orders
Task
Swipe to start coding
Write a query to list all customers and the amounts of their orders, showing NULL for customers who have not placed any orders.
- Use a
LEFT JOINto combine thecustomersandorderstables on thecustomer_idfield. - Select the
customer_idandnamefrom thecustomerstable, and theamountfrom theorderstable. - Ensure that all customers are included, even those who have not placed any orders.
- Sort the results by
customer_idand then byorder_id.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Awesome!
Completion rate improved to 4.76
Challenge: List All Customers and Their Orders
Swipe to show menu
Task
Swipe to start coding
Write a query to list all customers and the amounts of their orders, showing NULL for customers who have not placed any orders.
- Use a
LEFT JOINto combine thecustomersandorderstables on thecustomer_idfield. - Select the
customer_idandnamefrom thecustomerstable, and theamountfrom theorderstable. - Ensure that all customers are included, even those who have not placed any orders.
- Sort the results by
customer_idand then byorder_id.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 4
single