Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: List All Customers and Their Orders | Core Join Types and Their Applications
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
SQL Joins in Depth

bookChallenge: List All Customers and Their Orders

Tâche

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 JOIN to combine the customers and orders tables on the customer_id field.
  • Select the customer_id and name from the customers table, and the amount from the orders table.
  • Ensure that all customers are included, even those who have not placed any orders.
  • Sort the results by customer_id and then by order_id.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: List All Customers and Their Orders

Glissez pour afficher le menu

Tâche

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 JOIN to combine the customers and orders tables on the customer_id field.
  • Select the customer_id and name from the customers table, and the amount from the orders table.
  • Ensure that all customers are included, even those who have not placed any orders.
  • Sort the results by customer_id and then by order_id.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

some-alt