logo

Back to questions

Second Day Confirmation

Easy

New TikTok users sign up with their emails and each user receives a text confirmation to activate their account. Assume you are given the below tables about emails and texts.

Write a query to display the ids of the users who did not confirm on the first day of sign-up, but confirmed on the second day.

Assumption:

  • is the date when the user activated their account and confirmed their sign-up through the text.

Table:

Column NameType
email_idinteger
user_idinteger
signup_datedatetime

Example Input:

email_iduser_idsignup_date
125777106/14/2022 00:00:00
433105207/09/2022 00:00:00

Table:

Column NameType
text_idinteger
email_idinteger
signup_actionstring ('Confirmed', 'Not confirmed')
action_datedatetime

Example Input:

text_idemail_idsignup_actionaction_date
6878125Confirmed06/14/2022 00:00:00
6997433Not Confirmed07/09/2022 00:00:00
7000433Confirmed07/10/2022 00:00:00

Example Output:

user_id
1052

Explanation: User 1052 is the only user who confirmed their sign up on the second day.

PostgreSQL 14

Refer friends to get bonus content & cool prizes.