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
Data Governance and Metric Consistency
00:00
5 left

Data Governance and Metric Consistency

HardSQL · PostgreSQL

Problem

How do you handle data governance, taxonomy management, and metric consistency across large reporting outputs?

Using the provided tables, write a SQL query that identifies active reporting outputs whose metric definition differs from the approved definition or whose governance approval is missing. Include only active metrics and taxonomy terms.

Output

  1. One row per affected metric and taxonomy term
  2. Columns: metric_name, taxonomy_name, reporting_output_count, inconsistent_output_count, and alphabetized output_names
  3. Include only groups with at least one inconsistent reporting output, ordered by metric_name

Schema

reporting_outputs
ColumnTypeDescription
report_idPKINTUnique reporting output identifier
report_nameVARCHAR(100)Name of the reporting output
metric_idINTReferenced metric definition
taxonomy_idINTReferenced taxonomy term
definition_versionINTMetric definition version used by the output
formulaTEXTMetric calculation formula used by the output
is_approvedBOOLEANWhether the output passed governance approval
is_activeBOOLEANWhether the reporting output is currently active
metric_definitions
ColumnTypeDescription
metric_idPKINTUnique metric identifier
metric_nameVARCHAR(100)Canonical metric name
current_versionINTApproved metric definition version
canonical_formulaTEXTApproved calculation formula
is_activeBOOLEANWhether the metric definition is currently active
taxonomy_terms
ColumnTypeDescription
taxonomy_idPKINTUnique taxonomy term identifier
taxonomy_nameVARCHAR(100)Canonical taxonomy term
taxonomy_domainVARCHAR(100)Taxonomy classification domain
is_activeBOOLEANWhether the taxonomy term is currently active
Tablesreporting_outputsmetric_definitionstaxonomy_terms
Interviewer

Your question is Data Governance and Metric Consistency. 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.