Chapter 12 Part III — Data, Standards, and Interoperability

Databases, SQL, Warehousing, Data Quality, and Data Governance

How clinical data are stored, transformed, queried, governed, and prepared for trustworthy reuse.

Chapter Orientation

An informatics nurse does not need to become a database administrator, but must be able to reason about where data live, how tables relate, why reports disagree, and what happens between bedside documentation and an executive dashboard. Without that literacy, data problems can be mistaken for clinical problems and technical transformations can become invisible sources of error.

The goal of this chapter is therefore practical data fluency: enough database, SQL, warehouse, and governance knowledge to collaborate effectively with analysts and engineers while maintaining clinical meaning.

Learning Objectives

By the end of this chapter, you should be able to:

  1. Explain relational database concepts including tables, keys, relationships, and normalization.
  2. Read and critique basic SQL queries.
  3. Distinguish transactional databases from analytic repositories.
  4. Explain ETL/ELT and how transformations affect data lineage.
  5. Apply major data-quality dimensions to clinical datasets.
  6. Describe stewardship, ownership, access, retention, and governance responsibilities.

Lesson 12.1 — Relational Databases Organize Relationships, Not Just Rows

  • A table represents a defined type of entity or event. A patient table, encounter table, medication administration table, and observation table should not be interpreted as interchangeable lists. Each has a grain: what one row represents.

  • Grain is the first question to ask before calculation. If one row represents a patient in one table and one laboratory result in another, joining them can create multiple rows per patient. Failure to recognize grain is a common cause of inflated counts.

  • Keys connect records. A primary key uniquely identifies a row within a table. Foreign keys refer to identifiers in related tables. In clinical systems, patient, encounter, order, result, and medication identifiers help preserve relationships across events.

  • Normalization reduces unnecessary duplication in transactional systems. Instead of storing the same patient demographics on every lab result, normalized designs separate entities and reference them through keys. This improves consistency but makes reporting require joins.

  • Database structure reflects application design, not necessarily clinical intuition. A nurse may think of a wound assessment as one event, while the database stores header information, individual wound rows, measurements, interventions, and signatures in separate tables.

FFigure

Figure 12.1 — From Clinical Concept to Relational Tables

Production brief: Show Patient → Encounter → Wound Assessment → Wound Measurement tables with one-to-many relationships and keys. Label the grain of each table.
Alt text: Relational database example showing patient, encounter, assessment, and measurement tables linked by identifiers, with different row-level grains.

NI-BC Connection: Data Management and Healthcare Technology — databases, data relationships, integrity.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. What does table grain mean?
  2. Why can a join unexpectedly increase row count?
  3. Distinguish primary and foreign keys.
  4. Why might a clinically simple event be stored across multiple tables?

Lesson 12.2 — SQL Is a Language for Asking Structured Questions

  • SQL expresses a question against structured data. SELECT identifies what to return, FROM identifies the source, WHERE restricts rows, JOIN combines related tables, GROUP BY creates aggregation groups, and functions such as COUNT or AVG summarize values.

  • A syntactically valid query can still be clinically wrong. A query may run successfully while using the wrong denominator, including duplicate encounters, excluding null values incorrectly, or joining on the wrong key. Technical execution is not clinical validation.

  • Filters encode definitions. A report for “current residents” depends on what counts as current: census status, discharge timestamp, unit assignment, payer type, or snapshot date. Informatics professionals should make those assumptions visible.

  • Null is not automatically zero. A missing value may mean not assessed, not applicable, not interfaced, unknown, or absent. Converting all nulls to zero can create false certainty.

  • SQL literacy improves collaboration even when someone else writes the query. An informatics nurse should be able to ask: What is the grain? Which tables are joined? What is the denominator? How are duplicates handled? What does null mean? Which timestamp is used?

AIAI in Practice

AI in Practice — Generate, Then Interrogate SQL

LLMs can draft SQL rapidly. A safer workflow is to ask the model to state the assumed schema, grain, joins, filters, null handling, and expected row behavior before running the query. Then validate counts against known cases. Code that executes is not evidence that the logic is correct.

NI-BC Connection: Data Management and Healthcare Technology — SQL/reporting and data retrieval.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. Why can correct SQL syntax produce an incorrect clinical result?
  2. What assumptions are embedded in filters?
  3. Why should null not automatically become zero?
  4. Which questions should an informaticist ask before trusting a query?

Lesson 12.3 — Transactional Systems and Analytic Systems Optimize for Different Work

  • Operational databases prioritize reliable transactions. The EHR must record orders, assessments, administrations, and updates quickly and consistently while many users work simultaneously.

  • Data warehouses prioritize analysis. Warehouses reorganize and integrate data so analysts can query across time, systems, and subject areas without placing heavy analytic load on production systems.

  • Dimensional models can make analytics easier to understand. Fact tables often represent events or measures, while dimension tables describe patients, dates, locations, clinicians, or other context. This is different from the highly normalized structure common in transactional databases.

  • Data lakes and lakehouse architectures can store broader forms of data. These approaches may hold raw or semi-structured information at greater scale. Their flexibility increases the importance of catalogs, quality controls, lineage, and access governance.

  • A single “source of truth” is usually a governed definition, not one magical database. Different systems may legitimately own different facts. The organization needs authoritative definitions, provenance, and rules for resolving conflicts.

EClinical Example

Clinical Example — Two Census Numbers

Operations reports 248 residents at 08:00; finance reports 251 for the same date. Investigation shows that operations uses a live census snapshot while finance counts billable midnight census. Both calculations are internally correct. The disagreement is definitional, not necessarily technical.

NI-BC Connection: Data Management and Healthcare Technology — databases, data warehouses, data management.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. Why separate transactional and analytic workloads?
  2. How do fact and dimension tables differ conceptually?
  3. What governance challenges accompany flexible data lakes?
  4. Why can two correct reports produce different numbers?

Lesson 12.4 — ETL and ELT Transform Data Between Systems

  • ETL means extract, transform, load; ELT changes the order so transformation occurs after loading into the target analytic platform. The choice depends on architecture, scale, tooling, governance, and performance.

  • Transformations are analytic decisions. Converting local unit names, calculating age, assigning a resident to a service line, deduplicating encounters, or deciding which status wins are not neutral technical steps. They alter how data will be interpreted.

  • Lineage should preserve each important transformation. When a dashboard value is challenged, the team should be able to trace it back through source fields, business rules, and refresh processes rather than reverse-engineering the calculation from memory.

  • Refresh timing affects meaning. A “current” dashboard refreshed nightly is not real time. Informatics teams should label refresh frequency and understand latency between source events and analytic availability.

  • Migration is a special form of transformation. Moving from an old EHR to a new one requires decisions about what to convert, archive, summarize, or leave accessible in a legacy system. More data are not always safer if the conversion cannot preserve context reliably.

PInformatics in Practice

Informatics in Practice — Ask for the Transformation Logic

If a metric matters to operations or patient safety, its transformation rules should not exist only inside one analyst’s query. Definitions, source fields, inclusion/exclusion logic, and refresh timing should be documented and reviewable.

NI-BC Connection: Data Management and Healthcare Technology — migration, integrity, warehouses, data management.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. What changes between ETL and ELT?
  2. Why are transformations not purely technical?
  3. How does refresh timing affect interpretation?
  4. What decisions must be made during data migration?

Lesson 12.5 — Data Quality Is Fitness for a Defined Purpose

  • Accuracy asks whether data correctly represent the underlying event or state. This often requires comparison with a trusted source or direct validation rather than checking whether a field is populated.

  • Completeness asks whether required or expected information is present. High completeness can coexist with inaccurate values, so it should not be treated as the only data-quality dimension.

  • Consistency asks whether the same concept agrees across locations, systems, and time where agreement is expected. Inconsistent terminology or duplicate patient identities can undermine longitudinal analysis.

  • Timeliness asks whether data are available soon enough for their intended decision. A quarterly dataset may be suitable for strategic review but unsafe for same-day clinical intervention.

  • Validity asks whether data conform to expected formats, domains, and rules. A temperature of 785°F is probably invalid even though it is numeric. Plausibility rules can detect errors, but overly narrow rules can reject legitimate extremes.

  • Uniqueness addresses unintended duplication. Duplicate encounters, patients, or messages can inflate metrics and create clinical confusion.

AIAI in Practice

AI in Practice — Data Quality Hypothesis Generator

An LLM can propose reasons for a sudden metric change—workflow change, interface failure, denominator change, duplicated rows, missing documentation, or true clinical change. Treat those as hypotheses to test, not explanations to accept.

NI-BC Connection: Data Management and Healthcare Technology — data integrity, quality, and analysis.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. Why is data quality defined relative to purpose?
  2. How do accuracy and validity differ?
  3. When might data be accurate but not timely enough?
  4. What kinds of errors arise from duplication?

Lesson 12.6 — Data Governance Assigns Decision Rights and Accountability

  • Data governance defines who can decide what data mean, who may use them, and how they are managed. It is broader than database administration. Governance addresses definitions, quality, access, retention, stewardship, sharing, and acceptable use.

  • Data ownership and stewardship should be distinguished. Organizations use these terms differently, but a useful model is that accountable business/clinical leaders own decisions while stewards maintain definitions, quality processes, and operational coordination.

  • A data dictionary is a governance artifact. It should define important elements and metrics in plain language, identify source systems and owners, document calculation logic, and note limitations.

  • Access should reflect purpose and minimum necessary principles. Analysts do not automatically need unrestricted clinical data because their work is beneficial. Role, purpose, sensitivity, and legal requirements should shape access.

  • Retention and deletion are also governance decisions. Keeping everything forever increases cost, privacy exposure, and discovery burden. Deleting too aggressively can violate legal, clinical, or research obligations. Retention schedules should be deliberate.

EClinical Example

Clinical Example — Who Owns “Falls Rate”?

Quality defines falls per 1,000 resident-days, nursing operations counts residents with at least one fall, and finance counts claim-coded fall events. A governance council should not merely choose one number. It should name each metric, define its purpose, specify the source and denominator, and prevent one label from referring to three different calculations.

NI-BC Connection: Foundations and Data/Technology — information management, regulatory responsibilities, data governance.

?Retrieval Checkpoint

Retrieval Checkpoint

  1. What decisions belong to data governance?
  2. How can ownership differ from stewardship?
  3. What should a useful data dictionary contain?
  4. Why is retention a governance issue rather than only a storage issue?

Chapter Case Study — The Dashboard That Changed Overnight

A quality dashboard shows that falls increased 42% in one month across a multi-site organization. Leadership prepares an urgent corrective-action plan. The informatics analyst notices that a new EHR interface was activated at the beginning of the month. Previously, only nursing incident reports fed the warehouse. The new feed also imports emergency-department diagnoses, including some encounters caused by the same fall already documented internally.

An analyst used an LLM to rewrite the SQL during the interface project. The query runs without errors, and the LLM explains that the logic “appropriately counts fall events.” No formal data lineage document exists.

Analyze the case

  1. What data-quality dimensions are at risk?
  2. How could table grain and duplicate events distort the result?
  3. What should be reviewed in the SQL?
  4. Why is the LLM explanation insufficient validation?
  5. What lineage documentation should have existed before release?
  6. How should governance respond before leadership interprets the increase as a clinical trend?

Chapter Synthesis

  • Database literacy begins with grain and relationships.
  • SQL is executable logic, not proof of clinical correctness.
  • Warehouses and analytic platforms reshape data for secondary use.
  • ETL/ELT transformations must be documented because they change meaning.
  • Data quality is multidimensional and purpose-dependent.
  • Data governance makes definitions, access, stewardship, and accountability explicit.

Key Terminology

Grain
What one row in a dataset or table represents.
Primary key
Attribute or identifier that uniquely identifies a row.
Foreign key
Field that references a key in another table.
Normalization
Database design approach that reduces redundant storage and maintains relationships.
SQL
Structured Query Language used to retrieve and manipulate structured relational data.
Data warehouse
Repository optimized for integrated analytic use rather than operational transactions.
ETL/ELT
Patterns for extracting, loading, and transforming data between systems.
Data quality
Fitness of data for a defined purpose, commonly assessed through dimensions such as accuracy, completeness, consistency, timeliness, validity, and uniqueness.
Data stewardship
Operational responsibility for maintaining definitions, quality, and appropriate management of data.
Data dictionary
Governed documentation of data elements, definitions, sources, and related rules.

NI-BC Chapter Mapping

Domain Blueprint area Lessons Depth
III. Data/Technology Databases and warehouses 12.1, 12.3 Applied
III. Data/Technology SQL and reporting 12.2 Applied
III. Data/Technology Migration/data integrity 12.4–12.5 Applied
III. Data/Technology Data management/governance 12.5–12.6 Applied

Chapter Quiz

Answer each question, then select “Check answer” to reveal feedback. For Select All That Apply items, choose every correct option before checking. Expand “Why?” after checking to read the rationale.

1

One row in a medication-administration table represents one administration event. What concept does this describe?

Why?

Grain defines what one row represents. Here, the grain is one medication-administration event per row.

2

A query joins patients to encounters and produces more rows than patients. What is the most likely explanation?

Why?

A one-to-many relationship is expected when one patient has multiple encounters; a join therefore may legitimately create several encounter rows per patient.

3

Before accepting an AI-generated SQL query, an informatics professional should verify:Select all that apply

Why?

AI-generated SQL must be checked for joins, row grain, denominator logic, null handling, and known-case results because syntactically valid SQL can still produce wrong clinical measures.

4

Which environment is generally better suited for longitudinal cross-system analytics than real-time order entry?

Why?

Data warehouses are designed for integrated longitudinal analytics and reporting, whereas transactional EHR systems are optimized for operational care processes such as order entry.

5

Two departments report different census numbers because one uses midnight census and the other a live 08:00 snapshot. What is the primary issue?

Why?

Both numbers can be technically correct while representing different definitions of census. The discrepancy is semantic/operational definition rather than proof of database failure.

6

Which data-quality dimension is most directly concerned with information being available soon enough for its intended use?

Why?

Timeliness asks whether data are available soon enough for the decision or purpose they are intended to support.

7

Which are legitimate data-governance responsibilities?Select all that apply

Why?

Metric definitions, stewardship, access, retention, and authoritative-source documentation are all legitimate governance responsibilities.

8

A missing laboratory result is converted to zero in a report. What is the principal risk?

Why?

Converting missing to zero changes the meaning from “no observed value” to an apparently observed numerical value and can produce unsafe analysis.

9

What is the main purpose of data lineage?

Why?

Lineage documents the route from original source through transformations and storage to downstream use, supporting traceability and troubleshooting.

10

A metric’s formula exists only in one analyst’s unpublished query. What is the strongest informatics response?

Why?

A critical metric should have a governed definition, source fields, transformations, ownership, and change process rather than exist only as undocumented analyst knowledge. —

Progress: 0 of 10 checked.

References and Further Reading

  • DAMA International. (2017). DAMA-DMBOK: Data Management Body of Knowledge (2nd ed.). Technics Publications.
  • International Organization for Standardization / International Electrotechnical Commission. (2008; confirmed 2025). ISO/IEC 25012:2008 Software engineering—Software product Quality Requirements and Evaluation (SQuaRE)—Data quality model. https://www.iso.org/standard/35736.html
  • Agency for Healthcare Research and Quality. (2022). Obtaining and Using Data in Practice: A Handbook for Health IT Advisors and Practice Facilitators. https://www.ahrq.gov/evidencenow/tools/healthit-advisor-handbook.html
  • Agency for Healthcare Research and Quality. Improving and Using Electronic Health Records (EHRs) Data for Quality Improvement. https://www.ahrq.gov/evidencenow/tools/ehr-data-quality.html
  • U.S. National Library of Medicine. Unified Medical Language System (UMLS). https://www.nlm.nih.gov/research/umls/index.html
  • American Nurses Credentialing Center. (2025). Informatics Nursing Board Certification Examination: Test Content Outline. https://www.nursingworld.org/globalassets/informatics-tco_08292025-for-webposting.pdf