0% found this document useful (0 votes)
21 views23 pages

Lec 2

Uploaded by

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

Lec 2

Uploaded by

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

Database Environment

Chapter 2
Chapter Objectives

In this chapter you will learn:


• The purpose and origin of the three-level database architecture.
• The contents of the external, conceptual, and internal levels.
• The purpose of the external/conceptual and the conceptual/internal
mappings.
• The meaning of logical and physical data independence.
• The distinction between a Data Definition Language (DDL) and a Data
Manipulation Language (DML).
• A classification of data models.
• The purpose and importance of conceptual modeling.
• The typical functions and services that a DBMS should provide.
• The function and importance of the system catalog.
Functions of a DBMS
• Data storage, retrieval, and update
• A user-accessible catalog
• Transaction support
• Concurrency control services
• Recovery services
• Authorization services
• Support for data communication
• Integrity services
• Services to promote data independence
Database Environment
• A major aim of a database system is to provide users with an abstract
view of data,
• Hiding certain details of how data is stored and manipulated.
• A database is a shared resource
• Each user may require a different view of the data held in the
database
• Most commercial DBMSs based on the so-called ANSI-SPARC
architecture.
DreamHome case study
We may be interested in modeling:
• The “real-world” entities Staff, PropertyforRent, PrivateOwner, and
Client;
• Attributes describing properties or qualities of each entity (for
example, each Staff entry has a name, position, and salary);
• Relationships between these entities (for example, Staff Manages
PropertyforRent).
Entity Relationship Model for DreamHome
The Three-Level ANSI-SPARC
Architecture
External Level
• The users’ view of the database. This level describes that part of the
database that is relevant to each user.
• Each user can have a different view
Conceptual Level
• The community view of the database. This level describes what data
is stored in the database and the relationships among the data.
• All entities, their attributes, and their relationships;
• The constraints on the data;
• Semantic information about the data;
• Security and integrity information.
Internal Level
• The physical representation of the database on the computer. This
level describes how the data is stored in the database.
• Storage space allocation for data and indexes;
• Record descriptions for storage (with stored sizes for data items);
• Record placement;
• Data compression and data encryption techniques.
Schemas, Mappings, and Instances
• Database Schema
•The overall description of the database is called the database schema
Three different type of schemas in the database according to their abstraction
level.
1. External schemas (subschemas)
• At the highest level, we have multiple external schemas (also called
subschemas) that correspond to different views of the data.
2. Conceptual schema
• Which describes all the entities, attributes, and relationships together with
integrity constraints.
3. Internal schema
• Which is a complete description of the internal model, containing the
definitions of stored records, the methods of representation, the data fields,
and the indexes and storage structures used.
• Conceptual schema
• At the conceptual level, we have the conceptual schema,
• which describes all the entities, attributes, and relationships
together with integrity constraints.
• Internal schema
•At the lowest level of abstraction we have the internal schema,
• which is a complete description of the internal model, containing
the definitions of stored records, the methods of representation, the
data fields, and the indexes and storage structures used.
• There is only one conceptual schema and one internal schema per
database.
• The schema is specified during the database design process and is not
expected to change frequently.
• However, the actual data in the database may change frequently.
• for example, it changes every time we insert details of a new member
of staff or a new property.
• The data in the database at any particular point in time is called a
database instance.
• Many database instances can correspond to the same database
schema.
• The schema is sometimes called the intension of the database.
• An instance is called an extension (or state) of the database.
Data Independence
• A major objective for the three-level architecture is to provide data
independence,
• Which means that upper levels are unaffected by changes to lower
levels.
• There are two kinds of data independence: logical and physical.

Logical data independence


• The immunity of the external schemas to changes in the
conceptual schema
• Adding attributes, entities
Physical Data Independence
• The immunity of the conceptual schema to changes in the internal schema.
• Changes to the internal schema, such as using different file organizations
or storage structures.
• using different storage devices, modifying indexes or hashing algorithms.
• Should be possible without having to change the conceptual or external
schemas.
• From the users’ point of view, the only effect that may be noticed is a
change in performance.
• In fact, deterioration in performance is the most common reason for
internal schema changes
• Figure 2.3 illustrates where each type of data independence occurs in
relation to the three-level architecture.
Database Languages
• DDL
• Describe and name the entities, attributes, and relationships required
for the application, together with any associated integrity and security
constraints.
• system catalog
• DML
• A language that provides a set of operations to support the basic data
manipulation operations on the data held in the database.
•Insertion of new data into the database;
•Modification of data stored in the database;
•Retrieval of data contained in the database;
•Deletion of data from the database.
•The part of a DML that involves data retrieval is called a query
language.
a. Procedural DMLs
b. Nonprocedural DMLs
Fourth-Generation Languages (4GLs)
• Forms generators
• Report generators
• Graphics generators
• Application generators
Data Models and Conceptual Modeling
• Data Model
• An integrated collection of concepts for describing and manipulating
data, relationships between data, and constraints on the data in an
organization.
• Structural part, consisting of a set of rules according to which databases can
be constructed;
• Manipulative part, defining the types of operation that are allowed on the
data (this includes the operations that are used for updating or retrieving
data from the database and for changing the structure of the database).
• Set of integrity constraints, which ensures that the data is accurate.
Object-Based Data Models
• Entity-Relationship (ER)
• Semantic
• Functional
• Object-oriented
Record-Based Data Models
• Relational data model
• Network data model
• Hierarchical data model

You might also like