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.
Este exercício faz parte do curso
Introduction to SQL with AI
Instruções do exercício
- Give the AI a clear instruction to return each unique combination of customer ids and order dates.
Exercício interativo prático
Experimente este exercício completando este código de exemplo.
SELECT customer_id
FROM orders;