Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 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
Build my plan
Identify High-Ticket Inactive Customers
00:00
5 left

Identify High-Ticket Inactive Customers

MediumSQL · PostgreSQL

Problem

At Autodesk, the support team wants to find customers who generated a high number of support tickets in May 2024 but did not log into Autodesk Fusion during that same month.

Write a SQL query to return customers who meet these conditions.

Requirements

  1. Count support tickets submitted in May 2024 for each customer.
  2. Keep only customers with more than 3 tickets in that month.
  3. Exclude any customer who had an Autodesk Fusion login in May 2024.
  4. Return the customer's most recent Autodesk Fusion login before 2024-05-01. If none exists, return NULL.
  5. Order the result by ticket_count_past_month descending, then last_login_at ascending with NULLS FIRST.

Schema

customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
customer_nameVARCHAR(100)Customer full name
account_statusVARCHAR(30)Current account status
support_tickets
ColumnTypeDescription
ticket_idPKINTUnique support ticket identifier
customer_idINTCustomer who submitted the ticket
product_nameVARCHAR(100)Product associated with the ticket
submitted_atTIMESTAMPTicket submission timestamp
issue_typeVARCHAR(50)Support issue category
login_events
ColumnTypeDescription
login_idPKINTUnique login event identifier
customer_idINTCustomer who logged in
product_nameVARCHAR(100)Product used during login
login_atTIMESTAMPLogin timestamp
device_typeVARCHAR(30)Device used for login
Tablescustomerssupport_ticketslogin_events
Interviewer

Your question is Identify High-Ticket Inactive Customers. 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.