Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda 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

Tarefa

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.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 4
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: List All Customers and Their Orders

Deslize para mostrar o menu

Tarefa

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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 4
single

single

some-alt