Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
SQL for Signup and No-Stream Users
00:00
5 left

SQL for Signup and No-Stream Users

MediumSQL · PostgreSQL

Problem

A music platform wants to identify recently registered users who have not streamed any audio. Write a PostgreSQL query to return users who signed up within the last 30 days relative to September 15, 2026, and have no associated stream events.

Output

  1. One row per qualifying user, with columns user_id, email, and signup_at
  2. Include signups from August 16, 2026 through September 15, 2026, inclusive, and exclude users with any matching audio stream
  3. Rows with a NULL signup_at do not qualify. Rows with NULL email remain eligible when the other conditions are met.
  4. Sort by signup_at descending, then user_id ascending as a tie-breaker

Schema

users
ColumnTypeDescription
user_idPKINTUnique user identifier
emailVARCHAR(255)User email address
signup_atTIMESTAMPTimestamp when the user signed up
audio_streams
ColumnTypeDescription
stream_idPKINTUnique stream event identifier
user_idINTUser who generated the stream event
audio_content_idINTIdentifier of the streamed audio content
streamed_atTIMESTAMPTimestamp of the stream event
Tablesusersaudio_streams
Interviewer

Your question is SQL for Signup and No-Stream Users. 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
Sign up free to run your codeLog inLn 1
Run your query to see results here.