Distinct on multiple fields
Marketing wants to understand customer purchase frequency by looking at unique customer-date combinations. This will help them spot patterns in buying behavior across different time periods.
Use the AI assistant to generate a query that shows distinct customer-date pairs.
Cet exercice fait partie du cours
Introduction to SQL with AI
Instructions
- Give the AI a clear instruction to return each unique combination of customer ids and order dates.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
SELECT customer_id
FROM orders;