Professional Documents
Culture Documents
354 Ch2
354 Ch2
• Data Model:
– A set of concepts to describe the structure of a DB
(data types, relationships), operations for
manipulation of the DB, and constraints on the DB.
• Data Model Operations: Operations for
specifying DB retrievals and updates.
– Basic operations (insert, delete, modify, …)
– User-defined operations (e.g. calculate_credit_rating)
Types of Data Models
• Conceptual (high-level, semantic) data
models:
– close to the way users perceive data. (Also called
entity-based or object-based data models.)
• Physical (low-level, internal) data models:
– describe details of how data is stored in the
computer; managed by a DBMS and an DBA.
• Implementation (representational, logical)
data models:
– fall between the above two, balancing user views
with some computer storage details (e.g. most
relational data models).
Schemas
• Database Schema:
– The description of a database. Changes infrequently.
– Also called the intension.
– Includes descriptions of the DB structure, data types,
and constraints.
• Schema Diagram:
– A diagram of (most aspects of) a database schema.
– Data types, relationships, constraints are not shown
• Schema Construct:
– A component (or object) of the schema, e.g.,
STUDENT, COURSE.
Schemas vs. Instances
• Database State:
• The actual data stored in a database at a
particular moment in time.
• Also called database instance (or
occurrence or snapshot).
• Also called the extension.
An Example Schema Diagram
Database Schema/Database State
• Database State: the instantaneous content
of a DB => changes frequently.
• Initial Database State: the state when the
DB is loaded.
• Valid State: A state that satisfies the
structure and constraints of the database.
Example of
a DB State
Three-Schema Architecture
• A quasi-standard created by ANSI in the
1970s to support three of the important
DBMS characteristics:
• program/data independence
• multiple views
• use of a catalog to store the DB description
Three-Schema Architecture - 2
Defines DBMS schemas at three levels:
• Internal schema: describes physical storage structures
and access paths—how the data is stored.
• Typically uses a physical data model.
• Conceptual schema: describes the structure and
constraints of the entire DB for all users—what is stored
in the DB.
• Uses a conceptual or an implementation data model.
• External schemas: describe the user views.
• Typically uses the same data model as the conceptual level.