Description
Table: signups
+-------------+----------+ | Column Name | Type | +-------------+----------+ | email_id | integer | | user_id | integer | | signup_date | datetime | +-------------+----------+
Table: texts
+---------------+---------+ | Column Name | Type | +---------------+---------+ | text_id | integer | | email_id | integer | | signup_action | varchar | +---------------+---------+
email_idlinks the two tables. Each row oftextsrecords one confirmation text sent to a user.
Calculate the signup activation rate , the fraction of TK users who confirmed their account signup via text message. Express the result as a decimal rounded to 2 decimal places. Users may receive multiple confirmation texts before activating; only users present in the signups table are considered.
The result format is shown below.
Example
Input:
signups table: +----------+---------+---------------------+ | email_id | user_id | signup_date | +----------+---------+---------------------+ | 125 | 7771 | 06/14/2022 00:00:00 | | 236 | 6950 | 07/01/2022 00:00:00 | | 433 | 1052 | 07/09/2022 00:00:00 | +----------+---------+---------------------+ texts table: +---------+----------+---------------+ | text_id | email_id | signup_action | +---------+----------+---------------+ | 6878 | 125 | Confirmed | | 6920 | 236 | Not Confirmed | | 6994 | 236 | Confirmed | +---------+----------+---------------+Output:
+--------------+ | confirm_rate | +--------------+ | 0.67 | +--------------+Explanation:
Three users signed up. User 125 confirmed (1 text, confirmed). User 236 eventually confirmed (2 texts; the second was confirmed). User 433 received no texts, counted as not activated. 2 out of 3 confirmed, so 0.67.
Accepted
11/49
Acceptance Rate22.4%
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
-
Output
-
Expected
-