0% found this document useful (0 votes)
13 views21 pages

Lecture 2

حاسب
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views21 pages

Lecture 2

حاسب
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 2

Database System Concepts


and Architecture

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Chapter 2 Outline
 Data Models, Schemas, and Instances
 Three-Schema Architecture and Data
Independence

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Data Models, Schemas, and
Instances
 Data abstraction
 Suppression of details of data organization and
storage
 Highlighting of the essential features for an
improved understanding of data

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Data Models, Schemas, and
Instances (cont'd.)
 Data model
 Collection of concepts that describe the
structure of a database
 Provides means to achieve data abstraction
 Basic operations
• Specify retrievals and updates on the database
 the dynamic aspect or behavior of a
database application.
• This allows the database designer to specify a set of valid user-defined operations that
are allowed on the database objects. An example of a user-defined operation could be
COMPUTE_GPA, which can be applied to a STUDENT object.

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Categories of Data Models
• High-level or conceptual data models:
• Close to the way many users perceive data
• Representational (implementation) data models:
• Between conceptual model and physical model
• Easily understood by end users
• hide many details of data storage on disk but can be
implemented on a computer system directly
• Low-level or physical data models:
• provide concepts that describe the details of how data is
stored on the computer storage media, typically magnetic
disks.
• Concepts provided by physical data models are generally
meant for computer specialists, not for end users

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


High-level or conceptual data
models
• Entity
• Represents a real-world object or concept
• Attribute
• Represents some property of interest
• Further describes an entity

• Relationship among two or more entities


• Represents an association among the entities
• Example: “Entity-Relationship model”

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Entity-Relationship model for a company

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Categories of Data Models (cont'd.)
 Relational data model
 Representational (implementation) data
models used most frequently in traditional
commercial DBMSs
 Represent data by using record structures and
hence are sometimes called record-based
data models.

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Copyright © 2011 Ramez Elmasri and Shamkant Navathe
Categories of Data Models (cont'd.)
 Object data model: New family of higher-level
implementation data models Closer to conceptual data
models (UML)

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Categories of Data Models (cont'd.)
• Physical data models
• Describe how data is stored as files in the
computer by representing information such as
record formats, record orderings, and access paths
• Access path
• Structure that makes the search for particular database
records efficient
• Index
• Example of an access path
• Allows direct access to data using an index term or a
keyword

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Schemas, Instances, and Database
State
• Database schema
• Description of a database which is specified during
database design.
• is not expected to change frequently
• Schema diagram
• Displayed schema
• The diagram displays the structure of each record type but
not the actual instances of records.
• Schema construct
• Each object in the schema such as STUDENT or COURSE
• Database state or snapshot
• Data in database at a particular moment in time

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Schemas, Instances, and
Database State (cont'd.)

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Database Schema
vs. Database State
• Database State:
• Refers to the content of a database at a moment in time.
 The actual data stored in a database at a particular moment in
time. This includes the collection of all the data in the database.
 Also called database instance (or occurrence or snapshot).
• The term instance is also applied to individual database components,
e.g. record instance, table instance
• Initial Database State:
• Refers to the database state when it is initially loaded into the
system.
• Every time an update operation is applied to the database, we
get another database state
• Valid State:
• A state that satisfies the structure and constraints of the database.
Slide 2- 14

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Schemas, Instances, and Database
State (cont'd.)
 Schema evolution
 Changes applied to schema as application requirements change

 Distinction
 The database schema changes very infrequently.
 The database state changes every time the database is updated

 Schema is also called intension.


 State is also called extension

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Example of a database state

Slide 2- 16

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Three-Schema Architecture and
Data Independence
• The goal of the three-schema architecture is to separate the user
applications from the physical database.
• Internal level
• Describes physical storage structure of the database.
• The internal schema uses a physical data model and describes the complete details
of data storage and access paths for the database.
• Conceptual level
• has a conceptual schema
• Describes structure of the whole database for a community of users
• The conceptual schema hides the details of physical storage structures and
concentrates on describing entities, data types, relationships, user operations, and
constraints.
• External or view level
• Describes part of the database that a particular user group is interested in and
hides the rest of the database from that user group.

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Three-Schema Architecture and Data
Independence (cont'd.)

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Three-Schema Architecture
and Data Independence (cont'd.)

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Three-Schema Architecture
 Mappings among schema levels are
needed to transform requests and data.
 Programs refer to an external schema, and are
mapped by the DBMS to the internal schema
for execution.
 Data extracted from the internal DBMS level is
reformatted to match the user’s external view
(e.g. formatting the results of an SQL query for
display in a Web page)
Slide 2- 20

Copyright © 2011 Ramez Elmasri and Shamkant Navathe


Data Independence
• Capacity to change the schema at one level of
a database system
• Without having to change the schema at the next
higher level
• Types:
• Logical data independence is the capacity to
change the conceptual schema without having to
change external schemas or application programs
• Physical data independence is the capacity to
change the internal schema without having to
change the conceptual schema. Hence, the
external schemas need not be changed as well.

Copyright © 2011 Ramez Elmasri and Shamkant Navathe

You might also like