1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database...
-
Upload
cathleen-fox -
Category
Documents
-
view
216 -
download
0
Transcript of 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database...
![Page 1: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/1.jpg)
1
Chapter 2
Database Environment
![Page 2: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/2.jpg)
2
Chapter 2 - Objectives Purpose of three-level database architecture.
Contents of external, conceptual, and internal levels.
Purpose of external/conceptual and conceptual/internal
mappings.
Meaning of logical and physical data independence.
Distinction between DDL and DML.
A classification of data models. Purpose/importance of conceptual modelling. Typical functions and services a DBMS should provide.
![Page 3: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/3.jpg)
3
Objectives of Three-Level Architecture
All users should be able to access same data.
A change in a user’s view should not affect other users’ views.
Users should not need to know physical database storage details.
![Page 4: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/4.jpg)
4
Objectives of Three-Level Architecture
DBA should be able to change database storage structures without affecting the users’ views.
Internal structure of database should be unaffected by changes to physical aspects of storage.
DBA should be able to change conceptual structure of database without affecting all users.
![Page 5: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/5.jpg)
5
ANSI-SPARC Three-Level Architecture
![Page 6: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/6.jpg)
6
ANSI-SPARC Three-Level Architecture
External Level– Users’ view of the database. – Describes that part of database that is relevant to a
particular user.– The way perceived by end users.
Conceptual Level– Community view of the database. – Describes what data is stored in database and
relationships among the data.– The way perceived by the DBA & programmers.
![Page 7: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/7.jpg)
7
ANSI-SPARC Three-Level Architecture
Internal Level– Physical representation of the database on the
computer. – Describes how the data is stored in the
database. – The way perceived by the DBMS & OS.
![Page 8: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/8.jpg)
8
Differences between Three Levels
![Page 9: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/9.jpg)
Schemas versus Instances
Database Schema: The description of the database. It rarely changes.
– Includes descriptions of the database structure, data types, and the constraints on the database.
Database Instance (snapshot): The actual data stored in a database at a particular moment in time. Changes rapidly.
The concepts of Schema & Instances corresponds to Types & Values in programming languages, respectively.
9
![Page 10: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/10.jpg)
Schemas, Mappings, and Instances
10
Mapping is the process of transforming requests and results between the Internal, Conceptual & External levels.
• 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.
Two types of mapping:
– External / Conceptual mapping.
– Conceptual / Internal mapping.
![Page 11: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/11.jpg)
Example
Schema Instance
11
![Page 12: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/12.jpg)
12
Data Independence
Logical Data Independence– Refers to immunity of external schemas to
changes in conceptual schema.– Conceptual schema changes (e.g.
addition/removal of entities).– Should not require changes to external schema
or rewrites of application programs.
![Page 13: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/13.jpg)
13
Data Independence
Physical Data Independence– Refers to immunity of conceptual schema to
changes in the internal schema.– Internal schema changes (e.g. using different file
organizations, storage structures/devices).– Should not require change to conceptual or
external schemas.
![Page 14: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/14.jpg)
14
Data Independence and the ANSI-SPARC Three-Level Architecture
![Page 15: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/15.jpg)
15
Database Languages
Data Definition Language (DDL)– Allows the DBA or user to describe and name entities,
attributes, and relationships required for the application together with any associated integrity and security constraints.
– DDL is a descriptive language for defining and constructing the database.
– Allows users to specify the data types and structures and the constraints on the data to be stored in the DB.
– DDL compiler generates the meta-data that is stored in the data dictionary.
![Page 16: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/16.jpg)
16
Database Languages
Data Manipulation Language (DML)– Provides basic data manipulation operations on data held in
the database.– DML is a language for retrieving and updating (insert, delete, &
modify) the data in the DB.– Types of DML:
• Procedural Language (3GL): user specifies what data is required and how to get those data(allows user to tell system exactly how to manipulate data.) Ex:Java
• Nonprocedural Language(4GL): user specifies what data is required without specifying how to get those data(allows user to state what data is needed rather than how it is to be retrieved.) Ex:SQL
![Page 17: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/17.jpg)
17
Database Languages
Both DDL and DML are usually not considered distinct languages. Rather, they are included in a comprehensive integrated language.
For example, SQL relational database language is a comprehensive DB language which represents a combination of DDL and DML.
![Page 18: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/18.jpg)
18
Database Languages
DBMS have a facility for embedding DDL & DML (sub-languages) in a High-Level Language (COBOL, C, C++ or Java), which in this case is considered a host language
DBMSCall to DB
C,C++,Lisp,..
Local Vars(memory)
Application Program
![Page 19: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/19.jpg)
19
Data Model
Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization.
– To represent data in an understandable way.
Data Model comprises:– a structural part;– a manipulative part;– possibly a set of integrity rules.
![Page 20: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/20.jpg)
Categories of Data Models
Conceptual data models (Object-based): is the construction of an enterprise’s information that is independent of implementation details.
• Also called entity-based or object-based data models.
Logical data models (Record_based): is the logical description of an enterprise’s information with high level description of the implementation.
• Also called record-based data models.
Physical data models: is the physical description of how data is stored in the computer.
20
![Page 21: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/21.jpg)
Categories of Data Models
21
Physical model
Logicalmodel
Conceptualmodel
Hardware dependentSoftware dependent
Hardware independentSoftware dependent
Hardware independentSoftware independent
![Page 22: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/22.jpg)
22
Data Models
Conceptual data models (Object-based):– Entity-Relationship– Semantic– Functional– Object-Oriented
Logical data models (Record_based):
– Relational Data Model– Network Data Model– Hierarchical Data Model
Physical Data Models
![Page 23: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/23.jpg)
23
Record-Based Data ModelsRelational Data Model
![Page 24: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/24.jpg)
24
Record-Based Data ModelsNetwork Data Model
![Page 25: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/25.jpg)
25
Record-Based Data ModelsHierarchical Data Model
![Page 26: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/26.jpg)
26
Functions of a DBMS
Data Storage, Retrieval, and Update.
A User-Accessible Catalog.
Transaction Support.
Concurrency Control Services.
Recovery Services.
![Page 27: 1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.](https://reader036.fdocuments.us/reader036/viewer/2022062516/56649d985503460f94a832eb/html5/thumbnails/27.jpg)
27
Functions of a DBMS
Authorization Services.
Support for Data Communication.
Integrity Services.
Services to Promote Data Independence.
Utility Services.