Interview Query

Activity Conversion

1
Have you seen this question before?

You’re given three tables, users, transactions and events. We’re interested in how user activity affects user purchasing behavior. 

The events table holds data for user events on the website where the action field would equal values such as like and comment.

Write a query to prove if users that interact on the website (likes, comments) convert towards purchasing at a higher volume than users that do not interact.

users table

column type
id INTEGER
name VARCHAR
created_at DATETIME

transactions table

column type
user_id INTEGER
name VARCHAR
created_at DATETIME

events table

column type
user_id INTEGER
action VARCHAR
created_at DATETIME
Next question: Podcast Search
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query