Challenge: List All Customers and Their Orders
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 4
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Suggested prompts:
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Mahtavaa!
Completion arvosana parantunut arvoon 4.76
Challenge: List All Customers and Their Orders
Pyyhkäise näyttääksesi valikon
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 4
single