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
SQL and Data Modeling
00:00
5 left

SQL and Data Modeling

EasySQL · PostgreSQL

Problem

Describe your experience with SQL and data modeling in a professional setting.

Use the supplied relational schema to demonstrate that experience by producing a concise activity summary for active entities. Include entities without qualifying activity and classify them based on their total completed value.

Output

  1. One row per active entity, including entities without qualifying events.
  2. Return entity_name, group_name, completed_event_count, total_completed_value, latest_completed_date, and value_band.
  3. Include only completed events from 2025-01-01 through 2025-03-31. Order by total_completed_value descending, then entity_id ascending.

Schema

data_entities
ColumnTypeDescription
entity_idPKINTUnique entity identifier
entity_nameVARCHAR(100)Display name of the entity
entity_typeVARCHAR(50)Classification of the entity
is_activeBOOLEANWhether the entity is active
data_events
ColumnTypeDescription
event_idPKINTUnique event identifier
entity_idINTRelated entity identifier
event_dateDATEDate on which the event occurred
statusVARCHAR(30)Current event status
event_valueNUMERIC(12,2)Numeric value associated with the event
entity_groups
ColumnTypeDescription
group_idPKINTUnique group identifier
entity_idINTEntity assigned to the group
group_nameVARCHAR(100)Assigned group name
Tablesdata_entitiesdata_eventsentity_groups
Interviewer

Your question is SQL and Data Modeling. 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.