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
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess 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
Build my plan
Active Subscriber Usage Query
00:00
5 left

Active Subscriber Usage Query

MediumSQL · PostgreSQL

Problem

AT&T needs a January 2026 usage report for active subscribers. Write a PostgreSQL query that combines subscriber and plan data with usage events.

Requirements

  1. Use an INNER JOIN between subscribers and plans, so only subscribers with a valid plan are reported.
  2. Use a LEFT JOIN to retain active subscribers with no January usage before aggregation.
  3. Report each active subscriber's name, plan, January data usage in gigabytes, and usage event count.
  4. Use GROUP BY and HAVING to return only subscribers with at least 5,000 MB of January usage. Treat missing usage as zero, and order by usage descending.

Schema

subscribers
ColumnTypeDescription
subscriber_idPKINTUnique AT&T subscriber identifier
subscriber_nameVARCHAR(100)Subscriber's full name
plan_idINTAssigned wireless plan
statusVARCHAR(20)Subscriber account status
plans
ColumnTypeDescription
plan_idPKINTUnique wireless plan identifier
plan_nameVARCHAR(100)AT&T wireless plan name
usage_events
ColumnTypeDescription
event_idPKINTUnique usage event identifier
subscriber_idINTSubscriber associated with the event
usage_dateDATEDate when data was consumed
data_mbNUMERIC(10,2)Data consumed in megabytes
Tablessubscribersplansusage_events
Interviewer

Your question is Active Subscriber Usage Query. Start with the requirements and the three 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.