Domain Knowledge Embedding
Embed compact domain facts with scope and version next to their use.
These examples and illustrative results are independently authored teaching materials, not measured model results.
Use case
Generate a deployment query from an accurate schema. Active blocking deployment is a domain term, not something field names alone establish. Teaching PostgreSQL schema v2 is deployments(id,is_deleted,kind); active means is_deleted=false, and blocking kinds are halt or block_all. Fixture rows are (1,false,halt), (2,false,allow) and (3,true,block_all).
Mechanism
Provide field names, value meanings, version and table beside the query step. Confirm that the material matches the target schema, then translate domain conditions into predicates. Do not invent a plausible status field. Report schema differences or missing definitions before deciding necessary facts.
Bad example
Query active blocking deployments from the schema and rows above. Use whatever status field and values seem appropriate, without checking the schema version.
Good example
Use the supplied PostgreSQL deployments schema v2. Active is is_deleted=false; blocking kind is halt or block_all. Query id with those exact columns and values, explaining their domain definitions. If the target schema differs from v2, report the mismatch instead of guessing a status field. Check the result against the three teaching rows.
Why the change matters
Abstract business terms can be mapped to nonexistent columns or wrong enum values. Compact domain facts beside their use give each predicate a traceable origin and make a version mismatch an explicit failure path.
Observable expectation
An illustrative query is SELECT id FROM deployments WHERE is_deleted = false AND kind IN (‘halt’,’block_all’);. Only ID 1 should match: ID 2 is nonblocking and ID 3 is deleted.
Verify v2 columns and fixture filtering. An invented status column, a deleted match or an unreported schema difference fails. This is a static teaching derivation, not an executed database result.
Limits
Embed small stable facts; use versioned references for large or changing material. Definitions can expire, and query correctness also depends on real data and dialect. The source remains unconfirmed; this teaching schema is not a real deployment system.
Sources and evidence
Source text has not been located. This method meets the editorial criteria; its examples are independent teaching constructions.
Read the editorial criteria