Interview Query

Notification Type Conversion

0
Have you seen this question before?

We’re given two tables, a table of notification deliveries and a table of users with created and purchase conversion dates. If the user hasn’t purchased then the conversion_date column is NULL.

Write a query to get the conversion rate for each notification.

A user may convert only once.

Example:

notification_deliveries table

Column Type
notification VARCHAR
user_id INTEGER
created_at DATETIME

users table

Column Type
id INTEGER
created_at DATETIME
conversion_date DATETIME

Output:

Column Type
notification VARCHAR
conversion_rate FLOAT
Next question: Possible Triangles
.....
MySQL 8.0.17
Loading editor
Use Shift + Enter to run query