Look at each customer's first delivered order, for first orders placed before 1 December 2025. Compare customers whose first order used the WELCOME50 coupon with everyone else: what share placed another delivered order within 30 days of that first order?
Return used_welcome50 (true or false, never NULL), customers and ordered_again_30d_pct (rounded to 1 decimal place).
INTEGER · time promised at checkout, from ordered_at
Sample rows (9,173 total)
Sample rows from deliveries
order_id
partner_id
picked_up_at
delivered_at
distance_km
promised_minutes
1
182
2025-01-01 12:31:48
2025-01-01 12:46:29
4.8
35
3
200
2025-01-01 13:09:13
2025-01-01 13:12:55
2.2
30
5
218
2025-01-01 13:51:37
2025-01-01 14:15:14
2.8
30
7
108
2025-01-01 16:44:53
2025-01-01 16:49:29
2.3
25
8
100
2025-01-01 18:32:46
2025-01-01 18:36:45
1.1
20
4,181 rows · 4 columns
INTEGER · primary key, → orders
INTEGER · 1–5
INTEGER · 1–5, can be NULL
TIMESTAMP
Sample rows (4,181 total)
Sample rows from ratings
order_id
food_rating
delivery_rating
rated_at
3
4
NULL
2025-01-02 08:00:55
5
5
NULL
2025-01-01 21:55:14
7
4
5
2025-01-02 06:12:29
9
4
4
2025-01-03 02:11:41
10
3
4
2025-01-02 15:35:00
400 rows · 5 columns
INTEGER · primary key
TEXT
INTEGER · → cities
TEXT · bike | scooter | ev_scooter | bicycle
DATE
Sample rows (400 total)
Sample rows from delivery_partners
partner_id
name
city_id
vehicle_type
joined_date
1
Ananya Gowda
5
scooter
2023-01-08
2
Omkar Ghosh
3
bike
2024-08-21
3
Ayesha Qureshi
8
bike
2025-03-02
4
Vikram Krishnan
7
bike
2023-02-12
5
Varun Reddy
5
bike
2023-08-15
8 rows · 7 columns
TEXT · primary key
TEXT
INTEGER
INTEGER · rupees
INTEGER · rupees, on subtotal
DATE
DATE
Sample rows (8 total)
Sample rows from coupons
coupon_code
description
discount_pct
max_discount
min_order_value
valid_from
valid_to
WELCOME50
50% off your first order
50
100
199
2025-01-01
2025-12-31
BITE20
20% off any order
20
80
299
2025-01-01
2025-12-31
WEEKEND15
15% off on Saturdays and Sundays
15
75
249
2025-01-01
2025-12-31
IPL25
25% off during the cricket season
25
125
399
2025-03-22
2025-06-03
MONSOON10
10% off in July and August
10
60
199
2025-07-01
2025-08-31
8 rows · 4 columns
INTEGER · primary key
TEXT
TEXT
INTEGER · 1 = metro, 2 = smaller city
Sample rows (8 total)
Sample rows from cities
city_id
city
state
tier
1
Bengaluru
Karnataka
1
2
Mumbai
Maharashtra
1
3
Delhi
Delhi
1
4
Hyderabad
Telangana
1
5
Pune
Maharashtra
1
Ctrl/⌘ + Enter runs the query. Table and column names are suggested as you type. Press Esc then Tab to leave the editor with the keyboard.
Expected output (2 rows)
Expected output
used_welcome50
customers
ordered_again_30d_pct
false
1641
38.5
true
263
47.1
Row order doesn’t matter for this question. Numbers are compared with a tiny tolerance; text must match exactly.
Stuck?
Stored on this device only. Your latest query and “solved” status are remembered in this browser only. They don’t sync between devices, and clearing your browser data removes them.