14. Confirmed the Next Day

Easy

signups(user_id, signup_at) and confirmations(user_id, confirmed_at)

Return the user_id of everyone whose first confirmation fell on the calendar day immediately after they signed up.

Compare calendar days, not elapsed hours: signing up at 23:00 and confirming at 01:00 the next morning counts, even though only two hours passed. A user can have several confirmations, and only the earliest matters.

Tables

confirmations

user_id  confirmed_at
-------  -------------------
1        2026-03-02 10:00:00
2        2026-03-01 10:00:00
3        2026-03-06 01:00:00
4        2026-03-10 09:00:00
4        2026-03-11 09:00:00

signups

user_id  signup_at
-------  -------------------
1        2026-03-01 09:00:00
2        2026-03-01 09:00:00
3        2026-03-05 23:00:00
4        2026-03-10 08:00:00
5        2026-03-12 08:00:00

Expected result

user_id
-------
1
3

Sign in to write and run your own code.

Write one SELECT query