Top Banner
The Three-level Architecture I. External model II.Logical or conceptual model III.Internal or physical model Logical Data Models I. Semantic data model II.Record based model DATABASE ARCHITECTURE
21
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Chapter 2 DBMS

The Three-level ArchitectureI. External modelII. Logical or conceptual modelIII. Internal or physical model

Logical Data ModelsI. Semantic data modelII. Record based model

DATABASE ARCHITECTURE

Page 2: Chapter 2 DBMS

THE THREE-LEVEL ARCHITECTURE

External model Logical Or Conceptual Model Internal Or Physical Model

Page 3: Chapter 2 DBMS

THE THREE-LEVEL ARCHITECTURE

Page 4: Chapter 2 DBMS

EXTERNAL LEVEL

• The external level interacts directly with the user (end users or application programs). It changes the data coming from the conceptual level to a format and view that is familiar to the users.

• Consists of many user models or views• Has external records - records seen by users• May include calculated or virtual data• Devide in external schemas (sub-schemas)• Used to create user interface

Page 5: Chapter 2 DBMS

LOGICAL OR CONCEPTUAL MODEL

The conceptual level defines the logical view of the data.

• All entities, attributes, relationships represented• Includes all record types, data item types, relationships, semantic

information, security and integrity information• Described in logical schema

Page 6: Chapter 2 DBMS

INTERNAL LEVEL

• The internal level determines where data is actually stored on the storage devices.

• The DBMS and Operating System View• Physical implementation level• Includes data structures, file organizations used by DBMS• Depends on what DBMS is used

Page 7: Chapter 2 DBMS

WHAT IS DATA INDEPENDENCE

• Techniques that allow data to be changed without affecting the applications that process it.

Page 8: Chapter 2 DBMS

Slide 2- 8

TYPES OF DATA INDEPENDENCE

• Logical Data Independence: • The capacity to change the conceptual schema without having to change the

external schemas and their associated application programs.

• Physical Data Independence:• The capacity to change the internal schema without having to change the

conceptual schema.• For example, the internal schema may be changed when certain file

structures are reorganized or new indexes are created to improve database performance

Page 9: Chapter 2 DBMS

RECORD BASED MODELS

Page 10: Chapter 2 DBMS

¤ In this model database is structured in fixed-format records of several types.

¤ They allow the designer to develop and specify the logical structure and provide some options for implementation of the design

¤ It describes the data at the conceptual and view levels both.

¤ Specify overall logical structure of the database

Page 11: Chapter 2 DBMS

I. Hierarchical ModelII. Network ModelIII. Relational Model

Types:

Page 12: Chapter 2 DBMS

HIERARCHICAL MODEL

Page 13: Chapter 2 DBMS

¤ Oldest¤ Like a structure of a tree¤ Branches represent fields¤ Nodes represent record¤ Structure contains levels, or segments.¤ Higher layer is perceived as the parent of the segment

directly beneath it, which is called the child

Page 14: Chapter 2 DBMS

S1001 Ali Ahmad Computer Science

60

Csc01A Intro to Algo Talha TuF10 N45

S1002 Kamal Khan Computer Science

60

S1008 Noman Ch Computer Science

60

Example:

Page 15: Chapter 2 DBMS

NETWORK MODEL

Page 16: Chapter 2 DBMS

¤ Like hierarchical model¤ But may have many to many relation¤ It allows a record to have more than one parent¤ Replaces the hierarchical tree with a graph

Page 17: Chapter 2 DBMS

S1001 Ali Ahmad Computer Science

60

Csc01A Intro to Algo

Talha TuF10 N45

S1002 Kamal Khan Computer Science

60

S1008 Noman Ch Computer Science

60

Mth01A

Calculus I Mutiullah

MW9 R25

Example:

Page 18: Chapter 2 DBMS

:- A student taking two classes:- A teacher teaches different classes:- An employee works for two departments

Examples:

Page 19: Chapter 2 DBMS

RELATIONAL MODEL

Page 20: Chapter 2 DBMS

¤ Proposed by E.F. Codd¤ Uses relations¤ Contains tables¤ Tables represent relationships ¤ Columns represent attributes¤ It’s better than others

Page 21: Chapter 2 DBMS

STDID STDNAME MAJOR CREDITS

S1001 Ali Ahmad Computer Science

60

S1002 Kamal Khan Math 40

S1003 Shoaib Mansoor

Computer Science

60

C_ID CNAME PROF SCHED ROOM

Mth01A Calculus I Mutiullah MW9 R25

Csc01A Intro to Algo Talha TuF10 N45

Csc01B Programming I Imran TuThF9 N40

Student - TableEnrollment - Table

Class - Table

C_ID STDID Grade

Csc01A

S1001 B+

Csc01B

S1001 A

Mth01A

S1002 B

Csc01A

S1002 B