Order Addresses
Start Timer
0:00:00
Given a table of transactions and a table of users, write a query to determine if users tend to order more to their primary address versus other addresses.
Note: Return the percentage of transactions ordered to their home address as home_address_percent
.
Example:
Input:
transactions
table:
Columns | Type |
---|---|
id |
INTEGER |
user_id |
INTEGER |
created_at |
DATETIME |
shipping_address |
VARCHAR |
users
table:
Columns | Type |
---|---|
id |
INTEGER |
name |
VARCHAR |
address |
VARCHAR |
Example Output:
home_address_percent |
0.76 |
---|
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments