CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)
  • Week 1
    • 1.Data Modeling Overview
    • 2.Three-Level Schema and Modeling Stages
    • 3.Entities
    • 4.Attributes
    • 5.Relationships
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
  • Week 7
  • Week 8

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SQLD/Week 1/Day 2

Based on the SQLD exam syllabus·Report an error

SQLD· AssociateWeek 1 · Day 2~22 min read

Day 2 - Three-Level Schema and Modeling Stages

📌 Key Takeaways

  • The ANSI/SPARC three-level schema divides a database into three layers, external, conceptual, and internal, to achieve data independence.
  • Logical independence: even if the conceptual schema changes, the external schema (application programs) is not affected.
  • Physical independence: even if the internal schema (storage structure) changes, the conceptual schema is not affected.
  • Modeling proceeds in the order conceptual → logical → physical, and the further along you go, the lower the level of abstraction and the more concrete it becomes.
  • Normalization is done in logical modeling, and decisions about performance and storage method are made in physical modeling.

The Same Store Data, Looking Different to Each Person

A shipping clerk at the online store sees only the order number, recipient, and address. An accounting clerk sees only the order number, payment amount, and payment date. A DBA looks at which disk this data is stored on and with which indexes. In other words, the same data is viewed from three layers.

  • The reason for separating layers is to keep a change in one layer from spreading to another.
  • This structure was proposed by the SPARC committee of the American National Standards Institute (ANSI). That is why it is called the "ANSI/SPARC three-level schema architecture."

The Three-Level Schema

SchemaPerspectiveWhat it doesCount
External schemaUser perspectiveDefines the database as each user or application program sees it. Also called the view levelMany
Conceptual schemaIntegrated perspectiveDefines the database of the entire organization, integrating all users' perspectives. Entities, relationships, and constraints are held hereOne
Internal schemaPhysical storage perspectiveDefines how data is actually stored (record structure, indexes, storage location)One
  Shipping screen    Accounting screen    Customer My Page
  ┌──────────┐      ┌──────────┐      ┌──────────┐
  │ External 1│      │ External 2│      │ External 3│     ← External schemas (many)
  └────┬─────┘      └────┬─────┘      └────┬─────┘
       └──────────────┬──┴─────────────────┘
                      │  External/conceptual mapping  → logical independence
               ┌──────┴───────┐
               │  Conceptual   │                          ← Overall structure of customers, products, orders
               │  schema       │
               └──────┬───────┘
                      │  Conceptual/internal mapping  → physical independence
               ┌──────┴───────┐
               │  Internal     │                          ← Files, indexes, blocks
               │  schema       │
               └──────────────┘
  • External schemas differ per user, so there are many. There is one conceptual schema and one internal schema per database.
  • The conceptual schema holds "what the entire organization stores." How it is stored (indexes, files) is the job of the internal schema.
  • In terms of SQL, the external schema is closest to a view created with CREATE VIEW, the conceptual schema to table definitions, and the internal schema to storage structures such as tablespaces and indexes. It isn't an exact one-to-one correspondence; it's an analogy to aid understanding.

Two Kinds of Data Independence

The connection between schemas is called a mapping. Independence arises because the mapping absorbs the change.

IndependenceEven if this changesWhat is not affectedResponsible mapping
Logical independenceConceptual schemaExternal schema (application programs)External/conceptual mapping (application interface)
Physical independenceInternal schemaConceptual schema (and external schema)Conceptual/internal mapping (storage interface)

In the online store example, it looks like this.

  • Logical independence: A marketing_opt_in column was added to the customer table. The shipping screen doesn't use that column, so there is nothing to change.
  • Physical independence: The DBA created a new index on the order table and moved it to another disk. The table structure (the conceptual schema) is unchanged, so the SQL keeps running as is.

⚠️ It's easy to mix up the name pairs. Logical independence is the ability to withstand changes to the conceptual schema, and physical independence is the ability to withstand changes to the internal schema. If you memorize "logical" as paired with "external," you'll get it wrong. The side that changes is the conceptual schema, and the side that is protected is the external schema.

Without Data Independence

  • Every time the storage structure changes, application programs have to be rewritten.
  • Even though each user needs a different view of the data, everyone is forced to share one structure.
  • In the end, maintenance costs rise and data complexity increases. The three-level schema is a structure designed to reduce this problem.

The Three Stages of Modeling

If a schema is "the layers for viewing a finished database," then the modeling stages are "the order in which you build the database." The two are different concepts.

StageLevel of abstractionWhat it doesOnline store deliverable
Conceptual modelingHighestDraws the core entities and relationships comprehensively, centered on the business. Used for enterprise-wide modeling and establishing EA (Enterprise Architecture)The big picture of Customer — Order — Product
Logical modelingMediumAccurately defines keys, attributes, and relationships for system construction. Performs normalization. High reusabilityThe primary identifier of the Order entity, resolving M:N with Order Item, definition of each attribute
Physical modelingLowestDecides tables, column types, indexes, performance, and storage method to fit the actual DBMSThe ORDERS table, ORDER_DT DATE, index and partition design
  High abstraction                                 Low abstraction
  ───────────────────────────────────────────────────────────▶
  Conceptual modeling   Logical modeling        Physical modeling
  (what exists)         (exactly what it        (how to put it on
                         looks like)             the DBMS)
  • Going from conceptual → logical → physical, things become more concrete and closer to a specific DBMS.
  • A logical model is not yet tied to a specific DBMS. That is why you can build a physical model from the same logical model, whether for Oracle or another DBMS.
  • Normalization is the work of the logical modeling stage. Denormalization, which deliberately allows duplication for performance, is mainly considered in the physical modeling stage (covered in Week 2).

Putting Stages and Schemas Side by Side

The two concepts share a similar direction, "from abstract to concrete," which makes them good to ask about together.

ComparisonModeling stagesThree-level schema
What is dividedDesign processThe layers for viewing a database
Why it is dividedDesign while making things more concrete stage by stageTo achieve data independence
Stage namesConceptual, logical, physicalExternal, conceptual, internal
  • Both include the word "conceptual," which causes confusion. Conceptual modeling is the first stage of design, while the conceptual schema is the integrated data structure of the whole organization.
  • There is no "external" among the modeling stages, and no "logical" in the three-level schema. If "logical schema" or "external modeling stage" shows up in an answer choice, the terms have been mixed up.

Where Modeling Fits in a Project

An information system construction project proceeds roughly in the order planning → analysis → design → development → testing → transition. The modeling stages overlap with this flow.

Project phaseModeling mainly done
Planning and analysisConceptual modeling, logical modeling
DesignPhysical modeling
After developmentBuild the DB based on the model, and when changes arise, fix the model first
  • The data model and the process model (business flow) are created together. For example, as you organize the online store's "receive order" process, the attributes of the Order entity come to light.
  • This mapping varies a little from textbook to textbook. Some textbooks say the logical model is finished in the analysis phase, while others place the logical model in the design phase. The order (conceptual → logical → physical) is the same.

Tomorrow we'll look at the characteristics and classification of entities, the first element of the model.

📖 Glossary

  • Schema : A definition describing the structure and constraints of a database.
  • External schema : The database as seen by a single user or application program. There can be as many as there are users.
  • Conceptual schema : The data structure of the entire organization, combining all users' perspectives into one.
  • Internal schema : The definition of how data is actually stored on disk.
  • Mapping : A link that corresponds two schemas so that a change on one side does not spread to the other.
  • Data independence : The property that changing the schema of one layer does not affect the other layers.
  • Normalization : The work of splitting entities to reduce duplication. Done in the logical modeling stage.
  • EA (Enterprise Architecture) : A blueprint that organizes the business, data, and system structure of the entire organization at a glance.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

In the ANSI/SPARC three-level schema architecture, which schema defines the data structure of the entire organization's database, integrating the perspectives of all users?

Question 2

An online store DBA rebuilt the indexes on the order table and moved their storage location, but did not modify the table structure or the application programs. Which concept is most closely related to this situation?

Question 3

Which is the LEAST appropriate statement about the data modeling stages?

Question 4

Which is a correct statement about the three-level schema architecture?

Question 5

Which of the following is the most appropriate match between a modeling stage and its main deliverable?

PreviousData Modeling OverviewWeek 1 · Day 1Next EntitiesWeek 1 · Day 3

Official references

  • SQLD official exam syllabus(opens in a new tab)

On this page

  • Key Takeaways
  • The Same Store Data, Looking Different to Each Person
  • The Three-Level Schema
  • Two Kinds of Data Independence
  • Without Data Independence
  • The Three Stages of Modeling
  • Putting Stages and Schemas Side by Side
  • Where Modeling Fits in a Project
  • Glossary
  • Practice Questions