Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Data Governance and Metric Consistency

HardSQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is Data Governance and Metric Consistency. Start with the requirements and the three tables on the right.

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.

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
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results