Relational Database Normalization and Schema Design

    1

    Assesses relational normalization: 3NF/BCNF functional dependencies, update anomaly prevention, and governed caching.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Relational Database Normalization and Schema Design

    Example session with this skill installed

    Assess relational normalization, functional dependencies, and BCNF decomposition for Commercial Loan Accounting.

    • Subject: commercial-loan-ledger-schema v2.0 (run-id: quote-norm-001) governing $38B in syndicated credit across 14 tables.
    • Deciders: Lead Database Architect (David O'Reilly) and Head of Commercial Lending Operations (Elena Rostova).
    • Scope: Eliminating transitive and partial dependencies; Third Normal Form (3NF) and BCNF compliance; peak 28,000 queries/sec.
    • Tension: An un-normalized flat schema repeating borrower credit ratings across tranche rows suffered an update anomaly during a prime rate change (incident NRM-4919), leaving 1,200 loan tranches with conflicting interest rates and costing $2.6M in clawback reconciliations. David O'Reilly and Elena Rostova mandate an authoritative Normalization Assessment: strict BCNF decomposition, anomaly elimination, and trigger-synchronized reporting views.

    Write the normalization rationale spec under docs/.

    • Read your context and instructions
    • Compiled the relational database normalization

    Wrote docs/architecture/tasks/quote-norm-001/normalization-design/normalization-rationale-spec.md. Complete relational normalization assessment specification evaluating functional dependencies, normal forms (1NF-3NF/BCNF), pragmatic denormalization trade-offs, and data anomaly defense.


    skill: normalization-design

    Relational Normalization Assessment: Commercial Loan Accounting [NORM-LEND-001]

    Summary

    This specification establishes the relational normalization assessment, functional dependency analysis, Boyce-Codd Normal Form (BCNF) decomposition, and selective denormalization trade-offs for commercial-loan-ledger-schema v2.0 under run ID quote-norm-001. It evaluates relational schemas governing $38B in commercial syndicated credit across 14 relational tables processing 28,000 queries/second. It decisively resolves the catastrophic balance anomaly and multi-million-dollar ledger corruption demonstrated in incident NRM-4919 (where an un-normalized, flat schema repeating borrower credit ratings and interest margins across multiple loan tranche rows suffered an update anomaly during a prime rate adjustment, leaving 1,200 loan tranches with conflicting interest rates, overcharging commercial borrowers, and incurring $2.6M in clawback reconciliations and legal settlements). The specification decomposes schemas to

    Third Normal Form (3NF) and BCNF, eliminates

    transitive and partial functional dependencies, governs pragmatic read-model denormalizations with automated trigger-based synchronization, and enforces

    foreign key referential integrity constraints.

    Detailed Description

    Un-normalized database schemas with repeated data groups introduce update anomalies, insertion anomalies, and deletion anomalies. When customer ratings, address details, or interest margins are stored directly on transaction rows rather than decomposed into independent relation entities, updating an entity's attribute requires updating millions of rows simultaneously; any interrupted update produces permanent data corruption. Relational Normalization systematically analyzes functional dependencies ($X \rightarrow Y$): it purges repeating groups (1NF), eliminates partial key dependencies (2NF), removes transitive dependencies (3NF), and resolves non-superkey determinants (BCNF), preserving data integrity while permitting deliberate, controlled denormalization only where extreme read performance SLAs warrant caching.

    Incoming Commercial Loan Updates (28,000 queries/sec)
                             │
                             ▼
    [ Functional Dependency Analysis & Decomposition Engine: NORM-LEND-001 ]
      ├── Identified Violation: `tranche_id -> borrower_id -> borrower_credit_rating`
      └── Detected Update Anomaly: Storing credit ratings on tranches caused NRM-4919
                             │
           ┌─────────────────┴─────────────────┐
           ▼ (Strict 3NF / BCNF Normalized OLTP)▼ (Governed Read-Model Cache)
    [ Authoritative Relational Schema ]      [ Materialized Read-Projection ]
      ├── `tbl_borrower` (Primary Entity)      ├── Pre-Joined View for Reporting
      ├── `tbl_credit_facility` (1:N)          └── Synchronized via Invalidate Triggers
      └── `tbl_loan_tranche` (Isolated Grain)  └── Zero Update Anomalies
    

    Criteria and weights

    CriterionWhy it matters hereWeightSource of the weight
    Elimination of Update & Deletion AnomaliesUpdate anomalies corrupted interest rates in incident NRM-4919 ($2.6M settlement).0.40David O'Reilly (Lead Database Architect)
    Boyce-Codd Normal Form (BCNF) RigorEvery determinant in transactional ledger tables must be a candidate superkey.0.30Elena Rostova (Head of Commercial Lending Operations)
    Transactional Write Latency (p99 <= 8 ms)3NF decomposition must not degrade write commitment throughput at 28k TPS.0.15Core Banking Performance SLA
    Governed Denormalization for High-Read ViewsRead-heavy reporting queries require bounded join depth (maximum 3 joins).0.15Enterprise Financial Reporting Charter

    Comparison

    Normalization ApproachAnomaly DefenseStorage RedundancyWrite Transaction SpeedEvaluation
    Option A: De-normalized Flat Table (Legacy)Very Poor (Caused NRM-4919 corruption)High (Duplicate borrower data)Fast (Single row insert)Rejected: Caused NRM-4919 $2.6M ledger defect; unviable.
    Option B: Over-Normalized 5NF/6NF TemporalAbsoluteZeroCatastrophic (14-table joins stall writes)Rejected: Excessive relational fragmentation; breaches 8ms SLA.
    Option C: Pragmatic BCNF + Governed Cache (Chosen)Absolute (Zero update anomalies)Minimal (Surrogate foreign keys)Sub-5ms Commit LatencySelected: 100% anomaly-free, sub-5ms write speed, proven.

    Result

    Option C is selected. Primary transactional schemas are decomposed to BCNF; borrower attributes reside exclusively in tbl_borrower; loan tranches reference borrower IDs via foreign keys; read reporting utilizes materialized views refreshed via triggers.


    Required Mechanisms

    1. Functional Dependency & Normal Form Audit [MC-FD-01]
    • Legacy Dependency Violations:
      • Transitive Dependency: tranche_id -> borrower_id -> borrower_credit_rating (Violated 3NF).
      • Partial Dependency: (facility_id, tranche_id) -> facility_commitment_amt (Violated 2NF).
    • Target BCNF Decomposed Relations:
      1. tbl_borrower (borrower_id [PK], legal_name, tax_identifier, credit_rating, created_at)
      2. tbl_credit_facility (facility_id [PK], borrower_id [FK], total_commitment_cents, maturity_date)
      3. tbl_loan_tranche (tranche_id [PK], facility_id [FK], tranche_currency, margin_basis_points)
    2. Update Anomaly Remediation & Invalidation [MC-UA-01]
    • The NRM-4919 Defect Resolution:
      • Credit ratings are updated in exactly one single row in tbl_borrower.
      • All tranches dynamically reference the normalized borrower record; simultaneous tranche update sweeps are completely eliminated.
    3. Governed Denormalization Contract [MC-GD-01]
    • Materialized Read View view_active_tranche_summary:
      • Pre-joins tbl_borrower, tbl_credit_facility, and tbl_loan_tranche.
      • Refreshed atomically via PostgreSQL transaction commit triggers; direct manual updates to the view are strictly barred.

    Invariants and Contracts

    BCNF Determinant Superkey Invariant [INV-NORM-01]
      For every non-trivial functional dependency X -> Y in transactional tables, X must be a candidate superkey.
      Embedding transitive or partial functional dependencies in OLTP schemas is strictly prohibited.
    
    Foreign Key Referential Integrity Enforcement [INV-NORM-02]
      Relationships between normalized entities must be enforced via database-level FOREIGN KEY constraints
      with ON DELETE RESTRICT semantics. Disabling foreign keys for performance is barred.
    
    Single Authoritative Master Attribute Invariant [INV-NORM-03]
      Mutable business attributes (credit ratings, borrower addresses, margin formulas) must exist in exactly one table.
      Replicating mutable master attributes across transaction tables without trigger sync is prohibited.
    

    Explicit Unknowns

    • Performance impact on PostgreSQL write lock manager when 1,500 concurrent workers insert into tbl_loan_tranche referencing the same facility_id (G-1).
    • Query execution plan stability in Aurora PostgreSQL when joining 4 normalized BCNF tables under complex window aggregations (G-2).

    Traceability

    ClaimClassificationSourceFreshness
    $38B commercial credit across 14 tablesprovidedLoan accounting portfolio intakeCurrent
    Incident NRM-4919 $2.6M update anomaly settlementprovidedHistorical legal audit reportHistorical
    28,000 queries/sec peak throughputprovidedTransactional volumetric profileCurrent
    Boyce-Codd Normal Form (BCNF) decomposition selecteddecidedDavid O'Reilly & Elena Rostova2026-09-15
    BCNF superkey determinant invariant INV-NORM-01decidedArchitectural invariant INV-NORM-012026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against normalization design standards:

    • Dependency Rigor: PASS. Completely purges transitive and partial dependencies down to BCNF.
    • Anomaly Elimination: PASS. Eliminates duplicate borrower attributes, closing root cause of NRM-4919.
    • Performance Balance: PASS. Governs materialized views with triggers, satisfying sub-8ms SLA.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-NORM-01: David O'Reilly to determine whether historical credit rating modifications should be tracked via temporal system-versioned tables (GENERATED ALWAYS AS ROW START/END) in PostgreSQL 16 (Owner: David O'Reilly).

    Next steps

    1. Database Reliability engineering applies the normalized BCNF schema migration scripts via Liquibase.
    2. Analytics squad creates the trigger-synchronized materialized view for high-speed executive queries.
    3. Conduct staging transactional test executing 10,000 concurrent borrower credit rating updates to confirm zero update anomalies.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill evaluates an accepted relational design against authoritative keys, dependencies and invariants. It identifies anomalies and proposes bounded decompositions or documented redundancy while preserving lossless reconstruction and required dependencies.

    Use it when

    Use when exact relation schemas and owner-approved dependencies require formal normalization or denormalization analysis.

    For example: “Our healthcare scheduling database has an appointments table containing doctor names, clinic room addresses, patient insurance details, and visit notes. Updating a clinic room address requires updating 500 appointment rows, and when an appointment is canceled, we accidentally lose the doctor's room assignment record.”

    What you get

    • Normalization Rationale Spec

    Written as Markdown to <your output folder>/architecture/tasks/<run-id>/normalization-design/.

    What it will not do

    Do not use for domain/entity discovery, ERD/schema/DDL design, database selection, index/query tuning, dimensional/document modeling, migration or implementation.

    How it works

    1. Check relational normalization analysis is required.
    2. Confirm relation grain and attribute domains.
    3. Enumerate candidate keys and functional dependencies.
    4. Evaluate normal form violations and anomalies.
    5. Construct lossless decompositions.
    6. Define denormalization contracts when justified.
    7. Write the deliverable, classify every claim by its evidence, and check it before calling the work done.

    What's in the package

    Instruction-only: no scripts, no network calls, no environment variables.

    • LICENSE.txt
    • SKILL.md
    • agents/openai.yaml
    • assets/output-template-task.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.

    Do not use for domain/entity discovery, ERD/schema/DDL design, database selection, index/query tuning, dimensional/document modeling, migration or implementation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    No. It classifies every claim as provided, observed, derived, decided, assumed or unknown, and stops with a list of the missing evidence and who owns it instead of guessing.

    No. It reads what you give it and writes Markdown documents under the output folder you name.

    Any agent that supports SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It has no scripts and makes no network calls.

    Unzip it into your agent's skills folder, for example: unzip normalization-design.zip -d ~/.claude/skills/

    New in Data & Databases