Interview Query

Average Order Value

9
Have you seen this question before?

transactions table

column type
id integer
user_id integer
created_at datetime
product_id integer
quantity integer

users table

column type
id integer
name varchar
sex varchar

products table

column type
id integer
name string
price float

Given three tables, representing customer transactions and customer attributes:

Write a query to get the average order value by gender.

Note: We’re looking at average order value by user’s that have ever placed an order. Additionally please round your answer to two decimal places.

Output:

column type
sex varchar
aov float
Next question: Docs Metrics
MySQL 8.0.17
Loading editor