sql-two-products-no-default¶
Date: 2026-09-13. Status: implemented.
Decision. Two SQL sets, docs/sql/spd reading postcode_simd_history (key pc_norm, introduced_on) and docs/sql/sspl reading postcode_simd (key pc_norm), with no default or cross-product fallback. Each has standalone link_by_era.sql (id, postcode, analysis_year; edition by PHS v3.5 Table 4) and link_latest.sql (id, postcode; one edition throughout), with numbered steps distinguishing guidance from project choices. They share a 41-column core through band_direction, then append different own-record context: SSPL has 91 columns, SPD era/latest 107. Select common columns by name when combining results. The SPD set selects the latest life per full NRS key, then prefers live, whole or A, newest introduction; a best B/C-only record gets split_a_missing, a tie gets ambiguous_postcode, both without SIMD. SSPL needs neither selection step. Both follow LinkedSmallUserPostcode to a small-user record: SPD uses the exact suffix; SSPL accepts an A alias only for a whole record flagged SplitIndicator Y, and cannot resolve B/C. NO LINKP gets po_box, NO LINK/blank/null gets unlinked_large_user, without SIMD. The source record supplies all 14 stored measures and selected-vintage geographies; the matched record's own fields remain context. No chaining through large users.
Reason. Product and edition policy remain explicit study choices, but NRS recommends SSPL for statistical production and SPD for operational/administrative use. Applying linked-small-user geography to SSPL is a project interpretation of PHS Appendix A, which describes links and absent geography for PO boxes/unlinked large users but does not explicitly settle overriding geography already allocated in SSPL. Absence of contrary NRS guidance is not endorsement. Preserve the chosen policy pending authoritative confirmation or comparison with a PHS postcode-level oracle; retaining own-record context makes its effect visible. The SSPL suffix rule is also a project interpretation. Exact PHS lookup parity remains unverified.
Evidence. PHS v3.5 Appendix A pp.28-30, Table 4 p.17, sections 3.1-3.4; PHS postcode-file page (most recent version, A part only); NRS SSPL information note and 2026/2 dictionary; NRS SPD 2026/2 dictionary on PO-box grid references. Worked example AB24 2TY: own 2020v2 quintile 5, linked AB24 2TN quintile 1, identical in both tables. Plan: docs/plans/SQL_Two_Products_Plan.md.