Code converted to a number
Preserve the exact code and test loading does not remove leading zeros.
In-depth practical guides
Describe row grain, columns, types, units, missing values and keys before calculations or joins.
Updated :

AI-generated illustration
A column heading is insufficient to understand a file. A dictionary connects fields to definitions, value domains and schema versions. Distinguish the dataset from distributions such as CSV and API.
State object, geography and period: a company-year differs from an establishment-month. Specify the expected unique key and relationships with other tables.
For each column record exact name, definition, logical type, format, unit, code list, nullability and origin. Preserve leading-zero identifiers as text.
Test uniqueness, domains and required fields on the real file. Empty string, not applicable and zero differ. Date changes to definitions, codes or types.
Reading workshop
The DEMO contract defines one row per case. Its invented rules describe no real register.
Fictional data and records for learning: none of these results comes from a live service query.
The distribution is JSON: record_id is a four-digit string, state is OPEN or CLOSED, and amount is a decimal number or null. record_id must be unique. Case and types are part of the contract.
If the table exceeds the screen, scroll horizontally; arrow keys work when the region is focused.
| Field or rule | Test value | Contract reading | Action |
|---|---|---|---|
| record_id: text | "0042"; number 42 | The string is allowed; the number violates the type | Reject 42 without inventing its zeros. |
| state: exact code | OPEN; open | OPEN is allowed; open is outside the domain | Do not change case without an approved rule. |
| amount: number or null | 12.5; "12.5"; null; "" | The number and null are allowed; both strings are rejected | null means unknown; never default to zero. |
| Unique record_id | Two rows containing "0042" | The key repeats even when amounts differ | Block the output from approval and request the correct grain. |
Open each proposition to compare its diagnosis. More checks may still be needed.
No. This erases anomalies and introduces assumptions absent from the contract.
Yes. Separate type errors, invalid codes and duplicate keys. Resolve them using documentation or the producer.
No. This JSON contract distinguishes them. A CSV may have another rule, documented separately.
Contract: DEMO, one row per case, JSON record_id: four-digit text, unique key state: OPEN or CLOSED, exact case amount: decimal number or null; null=unknown Violations: type, code, empty string, duplicate key Decision: raw data retained, output not approved
This notation summarizes a teaching contract, not a complete executable schema. No user file is validated here.
Preserve the exact code and test loading does not remove leading zeros.
Identify currency, scale and period before summing; do not infer units from magnitude.
Guided reading of an excerpt
In this fictional example, each row describes a site for one year. The dictionary below sets the reading rules; the data deliberately contains an anomaly.
Fictional exercise: identifiers, values and dates illustrate the check. This excerpt is not a live collected response.
The pair site_id and year must be unique. A site may appear in several years.
site_id is a three-digit text identifier. amount_kEUR is an annual amount in thousands of euros; an empty cell means not reported.
Compare key pairs, preserve leading zeros and distinguish a zero amount from an unknown amount before aggregation.
site_id,year,amount_kEUR
007,2024,
007,2025,0
007,2025,12.5
site_id : string; pattern = ^[0-9]{3}$; required
year : integer; required
amount_kEUR : decimal; unit = 1000 EUR; empty = unknown
key : (site_id, year); uniqueNo. First resolve the duplicate key with the producer and define how to handle missing values. Summing only known values would hide the unknown row and could count the same site-year twice. Keep the original rows and document the decision.
Official references : W3C — Model for Tabular Data and Metadata on the Web
Worked exercise
Fictional example: the values and documents teach the method and do not describe a real organisation.
The producer defines amount in thousands of euros, rounded to one decimal place. The internal dictionary says only “number”; raw amounts are not supplied.
If the table exceeds the screen, scroll horizontally; arrow keys work when the region is focused.
| Row | amount |
|---|---|
| A | 1.2 |
| B | 2.5 |
Published values sum to 3.7 thousand euros, or 3,700 euros. Writing 3.70 creates no extra precision. Define the field's unit and explain that the sum uses rounded values rather than known exact amounts.
If unrounded raw amounts become available, calculate them separately and identify their version. Add a missing-value case to the fictional dataset: amount=0 means a known zero amount, whereas a cell declared unknown supplies no amount. Document the missing-value code and check that import does not silently turn it into zero before aggregation.
Keep definition, unit, scale, precision, missing codes and a valid example.
Documentation reference : W3C — CSV on the Web: A Primer · Consulted on
DOCUMENTED REFERENCE
RFC 6901 addresses a value inside JSON. It is neither JSONPath nor a modification operation. The reader uses a small invented teaching document, not real observations, distinguishing resolved value, missing path and invalid syntax.
| Reference | Value or form | What it identifies |
|---|---|---|
| "" | Root value | Empty string selects the whole document, not no result; empty input can be valid. |
| / | Empty member name | A slash selects a member named empty string, if present. This differs from the root. |
| ~1 | / inside member name | Encode a slash within a member name as ~1. Property a/b differs from a containing b. |
| ~0 | ~ inside member name | Encode tilde as ~0. Decode ~1 before ~0: ~01 means literal ~1, not slash. |
| /items/0 | Zero-based array index | Array indexing starts at zero; use non-negative decimal integers without extra leading zeros. |
| /items/01 | Invalid array index | 01 is not a valid array index but can be an exact object key. Container type matters. |
| /items/- | No existing array member | Dash selects a nonexistent position after the final array element. Reading does not automatically apply another protocol’s append convention. |
| #/a~1b | URI-fragment form | URI-fragment form starts # and also applies URI decoding. Encode literal percent there; ordinary text form must not be URI-decoded. |
Invented exercise document: these numbers are not observations. Read locally without requests or document changes.
{
"items": [
{
"id": "A",
"count": 0,
"note": null
},
{
"id": "B",
"count": 3,
"note": ""
}
],
"a/b": {
"m~n": true
},
"": false,
"01": "code",
"é": "accent",
"~1": "literal",
"c%d": "percent"
}Initial example: /items/0/count gives 0; /items/0/note gives null; /items/1/note gives an empty string; / gives false.
Value found · number
0Property names stay exact: no whitespace removal or accent normalization. The reader adds nothing and does not process JSONPath.
Compare exact names without accent, case or whitespace correction. Preserve null, false, zero and empty strings. Valid syntax may still resolve no value; do not manufacture zero. Keys and pointer syntax do not change with interface language.
The note member exists and explicitly holds null. An absent member resolves nothing; these differ in joins and table conversions.
Documentation consulted on .
DOCUMENTED REFERENCE
RFC 8259 defines exchange syntax, not unlimited precision in every reader. Long numeric identifiers may change during parsing, before a spreadsheet display. Examples are teaching forms, not assigned identifiers.
| Reference | Value or form | What it identifies |
|---|---|---|
| Integer interoperability | −9007199254740991 … 9007199254740991 | RFC identifies this integer range as interoperable with common binary64 precision, not JSON’s universal syntax limit. |
| Beyond 2^53 − 1 | binary64 · 2^53 + 1 | Beyond it, some integers remain exact but consecutive integers are not all distinguishable. Check actual reader type. |
| "00123" / 123 | "00123" ≠ 123 | String "00123" preserves zeros; number 123 does not. Codes need not be arithmetic quantities. |
| NaN / Infinity | JSON: ✗ | NaN and Infinity are not JSON numeric literals; accepting extensions does not establish strict compatibility. |
| Duplicate object names | SHOULD | Object names SHOULD be unique. Readers may retain last, reject duplicates or expose all pairs. |
| Network exchange | UTF-8 · RFC 8259 §8.1 | Exchanges outside closed ecosystems require UTF-8. Correct decoding does not prevent numeric rounding. |
Set types and precision before parsing. Stringifying a rounded number cannot recover digits. Detect forbidden duplicate names before overwrite; retain source text.
No. JavaScript numbers may already be rounded and repeated keys overwritten. Validate the source contract as well as parsed objects.
Documentation consulted on .
No: an example illustrates one value; a definition specifies all admissible values.
Document the common schema and distribution differences: names, formats and null rules.
Find the documentation and keep the uncertainty. Observed values can help formulate an assumption, but they are not always enough to confirm the meaning or the relevant operations.
TOOLS / REGISTERS
Test uniqueness, domains and required fields on the real file. Empty string, not applicable and zero differ. Date changes to definitions, codes or types.
DOCUMENTED REFERENCE
An id column is not automatically a primary key. Effective, validated constraints define guarantees. These rules are for PostgreSQL 18; other systems may treat unique-constraint NULLs differently.
| Reference | Value or form | What it identifies |
|---|---|---|
| PRIMARY KEY (a) | Unique and non-null | Simple primary key requires unique non-null values, not real-world correctness or temporal stability. |
| UNIQUE (a) | NULLs distinct by default | PostgreSQL UNIQUE allows repeated NULLs by default; uniqueness is not completeness. |
| UNIQUE NULLS NOT DISTINCT (a) | At most one NULL in this column | NULLS NOT DISTINCT permits at most one NULL in single column a but still allows one missing value. |
| PRIMARY KEY (a, b) | Unique pair · non-null components | Composite primary key makes the pair unique and both non-null, not each component individually unique. |
| FOREIGN KEY · MATCH SIMPLE | Any NULL may exempt reference | MATCH SIMPLE may exempt a composite referencing row when any component is NULL. |
| FOREIGN KEY · MATCH FULL | Only all-NULL exempts reference | MATCH FULL exempts only all-NULL rows; mixed null/non-null fails. Use NOT NULL for mandatory complete references. |
| CHECK (x > 0) | TRUE or unknown passes | CHECK passes TRUE or unknown. Missing x can pass x > 0; presence needs NOT NULL. |
JSON array of 0–50 rows; each row has 1–3 components, always the same count. A component is a string of at most 64 code points or null. Both joined tables must have the same width. Maximum 20,000 JSON characters per field. An empty string remains a value distinct from null.
Teaching examples and local calculation, with no database query or transmission of inputs. Case-sensitive comparison without trimming spaces, Unicode normalisation or type conversion. Results describe entered rows only; they do not certify actual database constraints.
Teaching example calculated; edit the inputs, then examine them.
| Key dataset | UNIQUE | UNIQUE NULLS NOT DISTINCT | PRIMARY KEY |
|---|---|---|---|
| [["001"],["002"]] | Compatible with this policy | Compatible with this policy | Compatible with this policy |
| [["001"],["001"]] | Incompatible with this policy | Incompatible with this policy | Incompatible with this policy |
| [[null]] | Compatible with this policy | Compatible with this policy | Incompatible with this policy |
| [[null],[null]] | Compatible with this policy | Incompatible with this policy | Incompatible with this policy |
| [["FR",null],["FR",null]] | Compatible with this policy | Incompatible with this policy | Incompatible with this policy |
| [["FR","001"],["FI","001"]] | Compatible with this policy | Compatible with this policy | Compatible with this policy |
{
"keys": [
[
null
],
[
null
]
]
}A foreign key alone does not make a one-to-one relationship; many children may reference a parent. Record exact columns, NULL policy and actual validation. CSV does not automatically carry database guarantees.
No. Export grain, combined vintages or missing key components may differ from the constrained table. Inspect these before deleting rows.
Documentation consulted on .
DEEPER READING / PRACTICE
A table contains short column names and codes that are difficult to interpret. The dictionary must give a useful definition and keep the ambiguities unresolved.
Updated on .
Document name, type, unit, modalities, missing values and examples. Identify the keys and fields whose meaning depends on another variable.
A digital type does not mean that we can add values. A code may represent a category, an identificator or an absent value.
The dictionary connects the original field, definition, reading rules and documentary source. The assumptions are separated from confirmed definitions.