CommencerCommencer gratuitement

Distinct values

You're exploring the orders table, which includes every order placed by each customer. You want to see which customers have made purchases, but the orders table shows repeat customers multiple times. You need a clean list without duplicates.

Get each customer to appear only once to show who has placed at least one order.

Cet exercice fait partie du cours

Introduction to SQL with AI

Afficher le cours

Instructions

  • Write a prompt that tells the AI to return a list of distinct customer IDs.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

SELECT customer_id
FROM orders;
Modifier et exécuter le code