Quick revision
The short answer
I would treat it as an ownership problem, not a SQL problem: agree with finance on one owned definition of revenue and the other core metrics, implemented once in a governed data model or metric layer with finance as the business owner. Then trace each existing report's lineage, explain and document every difference, migrate users to certified data sets and retire the duplicates on a published timeline, and protect the result with automated tests and change review on core models. A data governance role with funding keeps it from decaying.
What to remember
In this answer, we treated three revenue numbers as an ownership and process failure. We stabilised the board number, made finance the owner of one written definition implemented once by the data team, traced and reconciled every existing report, renamed reports that answer other questions, migrated users and retired duplicates on a timeline, and protected the result with ledger reconciliation tests, change review and a funded governance role.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would treat it as an ownership problem, not a SQL problem: agree with finance on one owned definition of revenue and the other core metrics, implemented once in a governed data model or metric layer with finance as the business owner. Then trace each existing report's lineage, explain and document every difference, migrate users to certified data sets and retire the duplicates on a published timeline, and protect the result with automated tests and change review on core models. A data governance role with funding keeps it from decaying.
Why this question is asked
Three revenue numbers in one board meeting is a moment that costs trust in every number the company produces. After 15 years, each report encodes its own small decisions: whether refunds are subtracted, which date counts, which currency rate, which orders are excluded. No single query is wrong in isolation, and that is why fixing a query does not fix the problem. Interviewers ask this at the most senior levels to see whether we recognise an organisational issue and can lead a change across finance, data and engineering. In this answer, we will walk through how a senior leader approaches it: stabilising the immediate situation, establishing an owned definition, reconciling the existing reports, migrating and retiring, protecting the result, and funding governance.
1First, Stabilise the Immediate Situation
Before the next board meeting, the company needs one number it can stand behind. The fastest path is a small working group, the finance controller, the head of data, and an engineer who knows the reporting systems, that takes the three numbers, explains each one, and agrees which definition the board will see, with a short written note of what is in and out. That number is presented with the note, and the board is told that a programme is under way to make all reports agree.
This step matters for trust, and it also produces the first concrete material for the long-term fix: the three different definitions, written down side by side.
2Establish One Owned Definition
The heart of the fix is ownership. Revenue is a finance concept, so finance owns its definition: whether it is recognised at order, shipment or payment, gross or net of refunds, discounts and tax, in which currency at which rate, and which channels or test accounts are excluded. The data team owns the implementation of that definition in one governed place, a metric layer or a certified data model, from which all reports read.
The definition is written as a short document with examples, and each choice records why it was made. Other core metrics, such as active customers, orders and margin, follow the same pattern once revenue is settled. Starting with the one metric that embarrassed the company gives the programme clear urgency and a visible first win.
- Agree the board number nowworking group, written note
- Finance defines revenuerecognition, refunds, tax, currency, exclusions
- Data team implements it oncegoverned model or metric layer
- Trace and reconcile old reportslineage, document each difference
- Migrate users, retire duplicatescertified data sets, published timeline
- Protect ittests on outputs, change review, named owners
6 steps in order. Play them, or step through them one at a time.
3Trace Lineage and Reconcile the Differences
Next we find every report that shows revenue, which after 15 years may be dozens, across BI tools, spreadsheets fed by queries and application dashboards. For each, we trace its lineage: which tables it reads, which joins it uses, which filters it applies. Then we reconcile each one against the certified number for a few months and explain every gap.
The differences usually fall into a few classes: refunds subtracted or not, order date versus payment date, currency converted at the daily rate versus the month-end rate, a join that fans out on order lines, internal test orders included, and one report that silently excludes a marketplace channel added in 2019. Each difference is documented with a decision: this report was wrong, or this report answers a different legitimate question and should be renamed, for example to gross bookings, so it stops looking like revenue.
| Report | Revenue | Difference explained by |
|---|---|---|
| Certified model | 12.40M | agreed definition |
| Sales dashboard | 13.10M | gross of refunds; rename to gross bookings |
| Finance monthly pack | 12.38M | month-end FX rate; aligned with finance |
| Board deck query | 14.02M | fan-out join on order lines; bug, retire |
4Migrate Users and Retire the Duplicates
Retiring old reports is the hardest part, because each has users who trust it and workflows built on it. We publish a timeline, for example certified data sets available now, old reports marked deprecated in one month with a banner pointing to the replacement, and removed in three months. Data team members sit with the heaviest users to rebuild their views on the certified data. Usage logs of the BI tool show who still relies on the old reports, so we can reach out to them before removal rather than after.
Reports that answer different but legitimate questions are kept, renamed and documented, so the catalogue shows clearly which number is revenue and which is something else.
5Protect the Result
Without protection, new reports will diverge again within a year. Core models get automated tests: totals reconcile with the general ledger within an agreed tolerance every month, row counts and keys are checked on each load, and a change to the revenue model needs review by the data team and sign-off by the finance owner. The certified data sets are marked as such in the BI tool, and board and finance packs may only use certified sources.
Finally, the company funds a data governance role, someone whose job is the metric catalogue, ownership, change process and the reconciliation reports. This is the part leaders most often skip, and the reason many companies have this meeting twice.
6Follow-up questions
How long does such a programme take?
The board number can be fixed in weeks. A certified revenue model with reconciliation usually takes one or two quarters, and retiring old reports another quarter or two, depending on how many there are. Doing revenue first and adding metrics one at a time keeps it manageable.
What if two departments insist on different definitions?
Often both are legitimate for different purposes, such as sales tracking bookings and finance reporting recognised revenue. The resolution is to give them different names and definitions, each owned, and to agree which one is called revenue in company reporting. The conflict is only harmful when both use the same word.
What is the role of engineering?
Engineering provides reliable source data, documents what fields mean, and keeps events such as refunds and order status changes recorded consistently, because a governed model can only be as good as the data it reads. Engineers also help trace lineage in old application queries.
7Conclusion
In this answer, we treated three revenue numbers as an ownership and process failure. We stabilised the board number, made finance the owner of one written definition implemented once by the data team, traced and reconciled every existing report, renamed reports that answer other questions, migrated users and retired duplicates on a timeline, and protected the result with ledger reconciliation tests, change review and a funded governance role.
Open with
I would say first that this is an ownership and process problem more than a SQL problem. Each of the three reports is probably correct for some definition of revenue, and after 15 years nobody owns the definition.
Then, if they want more
Immediately, I would form a small group with the finance controller, the head of data and an engineer who knows the reports, explain the three numbers, and agree the number the board sees, with a written note of what it includes.
Then the real fix: finance becomes the business owner of the revenue definition, recognition point, refunds, tax, currency rate, exclusions, written down with examples, and the data team implements it once in a governed model or metric layer that all reports read. Next we trace the lineage of every report that shows revenue and reconcile each against the certified number.
The differences are usually refunds, date choice, currency rates, a fan-out join or a missing channel. Each gets a documented decision: either the report is wrong and is retired, or it answers a different question and gets renamed, like gross bookings. We publish a deprecation timeline, help heavy users migrate, and use usage logs to find stragglers.
To keep it fixed, core models get automated tests that reconcile with the general ledger, changes need review and finance sign-off, and board packs use only certified data sets. And I would fund a data governance role, because without one this meeting happens again.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, The SQL Language
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company has 15 years of reports, each with its own join logic for revenue, and...": https://scrivio-interview-library.netlify.app/databases/sql-joins-and-subqueries/e3bb37c868/