Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL Sign-Up Trends Query
00:00
5 left

SQL Sign-Up Trends Query

MediumSQL · PostgreSQL

Problem

Write a SQL query to extract user sign-up trends over the last quarter on Quizlet.

Return monthly sign-up counts for each acquisition source during the most recently completed calendar quarter. Use the users and signup_sources tables.

Output

  1. One row per month and acquisition source, including sources with zero sign-ups
  2. Columns: signup_month, acquisition_source, and signup_count
  3. Include all three months in the quarter and order by month ascending, then acquisition source ascending

Schema

users
ColumnTypeDescription
user_idPKINTUnique Quizlet user identifier
emailVARCHAR(255)User email address
signed_up_atTIMESTAMPTimestamp when the user created an account
source_idINTAcquisition source associated with the sign-up
signup_sources
ColumnTypeDescription
source_idPKINTUnique acquisition source identifier
source_nameVARCHAR(100)Name of the acquisition source
Tablesuserssignup_sources
Interviewer

Your question is SQL Sign-Up Trends Query. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.