Get startedGet started for free

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.

This exercise is part of the course

Introduction to SQL with AI

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

SELECT customer_id
FROM orders;
Edit and Run Code