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

Dropbox

Snap

Netflix

Square

Zalando

Expedia

Did you come across this question in an interview?

Answers

Anonymous

5 months ago
4.4Exceptional
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;
  • Write a SQL query for the average transaction amount for customers who have made more than 10 purchases in the last 90 days.
  • How could you calculate the average transaction amount for customers who have made more than 10 purchases in the past 90 days?
  • What is the average amount of transactions for customers who have recently made more than 10 purchases in the last 90 days?
  • Tell me the average transaction amount for customers who have made more than 10 purchases within the last 90 days?
  • How would you determine the average transaction amount for customers with more than 10 purchases in the last 90 days?
  • What would be the average transaction amount for customers who made over 10 purchases within the last 3 months?
  • Can you provide me the average value of transaction for customers who have made over 10 purchases in the past 90 days?
  • How can we calculate the average transaction value for customers who have made more than 10 purchases in the last 90 days?
  • What is the average amount spent by customers who have made more than 10 purchases in the last 3 months?
  • What is the typical transaction amount for customers who have made more than 10 purchases in the past 90 days?
  • Can you tell me what the average transaction amount is for customers who have made over 10 purchases in the last 90 days?

Interview 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..