SQL Activation Rate Basics Quiz Quiz

Test your foundational knowledge of calculating signup activation rates in SQL using relational tables like emails and texts. This quiz covers concepts such as table relationships, JOIN types, aggregate functions, and rounding results—key areas for SQL interview preparation.

  1. Understanding Activation Rate Calculation

    Which SQL aggregate function is commonly used to count the number of distinct users in a table?

    1. SUM(DISTINCT ...)
    2. AVG(DISTINCT ...)
    3. MAX(DISTINCT ...)
    4. COUNT(DISTINCT ...)
  2. Identifying Primary and Foreign Keys

    If email_id is a primary key in the emails table, what does it represent in the related texts table?

    1. Candidate key
    2. Foreign key
    3. Non-key column
    4. Composite key
  3. Understanding Table Relationships

    What kind of relationship exists between the emails table and the texts table if one email can have multiple corresponding texts?

    1. Many-to-many
    2. One-to-one
    3. Many-to-one
    4. One-to-many
  4. Selecting Activated Users

    Which SQL clause would you use to filter records in the texts table where signup_action equals 'Confirmed'?

    1. GROUP BY signup_action = 'Confirmed'
    2. WHERE signup_action = 'Confirmed'
    3. HAVING signup_action = 'Confirmed'
    4. ORDER BY signup_action = 'Confirmed'
  5. Joining Tables

    To list only users present in both emails and texts tables, which type of JOIN should you use?

    1. INNER JOIN
    2. FULL JOIN
    3. LEFT JOIN
    4. RIGHT JOIN
  6. Purpose of DISTINCT

    Why is the DISTINCT keyword used when counting users with a confirmed signup in SQL?

    1. To group users by email
    2. To remove NULL values only
    3. To avoid counting the same user more than once
    4. To sort the results alphabetically
  7. Calculating Percentages

    What mathematical operation accurately calculates the activation rate for users?

    1. Sum of all signup_actions
    2. Confirmed users divided by total users
    3. Total users minus confirmed users
    4. Total users divided by confirmed users
  8. Rounding Numeric Results

    Which SQL function is used to round the activation rate to two decimal places?

    1. TRUNCATE(..., 2)
    2. ROUND(..., 2)
    3. CEIL(..., 2)
    4. FLOOR(..., 2)
  9. Purpose of LEFT JOIN

    Why would you use a LEFT JOIN when calculating activation rates?

    1. To exclude all NULL values automatically
    2. To include all users from the emails table, even if they have not confirmed
    3. To include only users with a confirmation
    4. To group users by action type
  10. Limitations of Aggregation

    What could happen if you omit the DISTINCT keyword when counting confirmed users in the activation rate calculation?

    1. The total number of users would be counted instead
    2. Users who confirmed more than once would be counted multiple times
    3. NULL values would be removed from the results
    4. The result would always be zero