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
Join Customer Tickets and Error Logs
00:00
5 left

Join Customer Tickets and Error Logs

HardSQL · PostgreSQL

Problem

You are given customer, ticket, and error-log data for an Aveva support workflow. Write a PostgreSQL query that joins the three tables to help troubleshoot a recurring issue by returning each customer’s open or recently closed tickets with the matching error details, including a flag that marks whether the error appears more than once for that customer.

Use the data to surface only tickets tied to the recurring error pattern and order the result so the most recent ticket appears first.

Schema

customers
ColumnTypeDescription
customer_idPKINTPrimary key for the customer
customer_nameVARCHAR(100)Customer display name
account_tierVARCHAR(50)Support tier or contract level
tickets
ColumnTypeDescription
ticket_idPKINTPrimary key for the ticket
customer_idINTReferences customers.customer_id
opened_atTIMESTAMPTimestamp when the ticket was opened
closed_atTIMESTAMPTimestamp when the ticket was closed
statusVARCHAR(30)Ticket status
issue_codeVARCHAR(50)Issue code reported on the ticket
error_logs
ColumnTypeDescription
error_idPKINTPrimary key for the error event
customer_idINTReferences customers.customer_id
occurred_atTIMESTAMPTimestamp when the error occurred
error_codeVARCHAR(50)Machine-readable error code
error_messageTEXTHuman-readable error message
Tablescustomersticketserror_logs
Interviewer

Your question is Join Customer Tickets and Error Logs. 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.