SQL
Write a SQL query for the average transaction amount for customers who have made more than 10 purchases in the last 90 days.
Data Scientist
Square
Netflix
Snap
Dropbox
Samsara
Zalando
Answers
Anonymous
6 months ago
SELECT customer_id,
AVG(transaction_amount) AS avg_transaction_amount
FROM transactions WHERE transaction_date >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY customer_id
HAVING COUNT(transaction_id) > 10;
Try Our AI Interviewer
Prepare for success with realistic, role-specific interview simulations.
Try AI Interview NowInterview question asked to Data Scientists interviewing at Discord, Tesla, Square and others: Write a SQL query for the average transaction amount for customers who have made more than 10 purchases in the last 90 days..