Your reading path
Start with the right questions.
From principle to practice
Worked example: a perfect match rate can inflate revenue
Open the worked exampleWrite the relationship before writing the query
Start with a sentence such as “each order belongs to one customer record valid on its order date.” That sentence specifies more than two column names: it identifies the transaction unit, expected cardinality and historical lookup rule. If a row represents an order line rather than an order, document that difference before comparing totals.
Ask whether identifiers are unique globally, within a company, or only within a source system. A composite key such as source_system plus customer_id may be necessary. Do not trim, case-fold or cast keys to numbers without recording the transformation: leading zeroes and case can be meaningful. The W3C tabular-data model provides a vocabulary for table schemas and foreign-key relationships; an actual collection still needs its own field definitions.
Worked example: a perfect match rate can inflate revenue
The following SQLite example is deliberately defective. There are three orders and every order finds a customer. However, customer C1 occurs twice in the lookup table. Both of its orders are repeated in the joined output, so a 100% match rate accompanies an inflated monetary total. These are invented diagnostic rows, not operational Fiund data.
WITH orders(order_id,customer_id,amount) AS (
VALUES ('O1','C1',100),('O2','C1',50),('O3','C2',80)
), customers(customer_id,region) AS (
VALUES ('C1','West'),('C1','East'),('C2','North')
)
SELECT COUNT(*) AS joined_rows, SUM(o.amount) AS joined_amount
FROM orders o LEFT JOIN customers c
ON o.customer_id=c.customer_id;
-- Expected: joined_rows=5, joined_amount=380.
-- Original orders: 3 rows, total amount=230.
Interpret the discrepancy before fixing it
The output has five rows and a sum of 380 instead of three orders totaling 230. O1 contributes 200 rather than 100; O2 contributes 100 rather than 50; O3 remains 80. The difference is explained by cardinality, not a rounding error. SQLite’s SELECT documentation describes how matching input combinations form join results.
Do not repair this result by applying DISTINCT to the final amount. Two genuine orders can share an amount, and duplicated customer rows may represent legitimate historical versions. Resolve the meaning of the right-side records first: reject unintended duplicate keys, choose a documented effective-date version, or keep the many-to-many relationship as a separate relation rather than flattening it.
A minimum reconciliation report
Run these checks on the proposed delivery and on relevant source slices. A single overall percentage can conceal one broken organization or month. Keep counts both before and after any documented exclusions.
- Check
- Lookup uniqueness
- What to count
- Rows and distinct complete lookup keys
- What a failure may mean
- Repeated entities, incomplete composite key or historical versions
- Check
- Unmatched transactions
- What to count
- Left-side keys with no approved target
- What a failure may mean
- Missing reference table, deleted records or incompatible snapshots
- Check
- Output grain
- What to count
- Rows per original transaction identifier
- What a failure may mean
- Multiplication, aggregation or lost transactions
- Check
- Control totals
- What to count
- Amounts and distinct entities before and after
- What a failure may mean
- Duplicated values, filtering or inconsistent units
- Check
- Null and malformed keys
- What to count
- Missing, blank and invalid values separately
- What a failure may mean
- Unknown identity or a parsing problem, not one generic missing bucket
Keep unmatched rows visible
Use a left-side reconciliation or a separate anti-join report when checking a source. An inner join answers a different question: it returns matched combinations and can make a defective delivery look clean by removing the evidence. Document the denominator for a match rate: transactions, distinct keys or monetary value lead to different interpretations.
For example, three unmatched orders out of 1,000 may appear minor, but they could contain the only orders from a required market. Review unmatched records by source, period and business category, then assign an explanation such as intentionally excluded, unresolved reference, or source defect. Acceptance thresholds should follow the planned task and consequence of error; this guide does not prescribe a universal percentage.
Historical joins need an event-time rule
If a customer moved region in June, a March order should not automatically inherit the customer’s current address. Ask for valid-from and valid-to fields, whether intervals can overlap, and how open-ended intervals are encoded. Specify an inclusive/exclusive boundary convention and test transactions exactly on a change date.
Also separate event time from the time a correction became available. A forecasting dataset may require what the organization knew on the decision date, rather than the corrected history visible today. Preserve the original transaction identifier and the selected lookup-version identifier so a reviewer can reconstruct the choice.
What to include in a business-data sourcing brief
Send a small relationship diagram, field dictionary, expected output grain and a few hand-checked examples. Add reconciliation queries, treatment of unresolved matches, the decision-time requirement and a source-level exception report. This gives a buyer a concrete acceptance artifact rather than a generic promise of “clean linked tables.”
A useful pilot deliverable contains the source tables, documented transformations, joined result, diagnostic counts and a list of unresolved cases. Confirm which preparation work is in the quote. A provider’s ability to supply files does not establish that a particular join, historical lookup or commercial use has already been validated.
Questions buyers ask
Sources & research notes
Public documentation reviewed 2026-11-13. Provider descriptions and published terms are attributed below. Published facts are attributed to their sources. Worked files are labeled as illustrative or as an inspected editorial source; neither implies commercial dataset clearance.
- Model for Tabular Data and Metadata on the WebW3C · Reviewed 2026-11-13
Schema and relationship terminology; the invented example and review procedure are original to this guide.
- SELECT: joins and matching input combinationsSQLite · Reviewed 2026-11-13
Reference for interpreting the runnable SQLite example, not evidence of a customer dataset.
