Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Systems Instructor Name: Lecture-3.

Similar presentations


Presentation on theme: "Database Systems Instructor Name: Lecture-3."— Presentation transcript:

1 Database Systems Instructor Name: Lecture-3

2 Today’s Lecture Data Abstraction Data Models Instances, Schemas
Three Level Architecture 2

3 Data Abstraction View Level Logical Level Physical Level 3

4 Data Models Access path Index
A set of concepts to describe the structure of a database, the operations for manipulating these structures, and certain constraints that the database should obey. Provide Means to achieve data abstraction Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. (Also called entity-based or object-based data models.) Physical (low-level, internal) data models: Provide concepts that describe details of how data is stored as files in the computer. 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 4

5 Data Models Relational Model Entity Relationship Model
Table based data storage, tables are also called relations. Table has columns and data is structured in fixed format records of several types. Entity Relationship Model Uses and Entities and relationship among entities Object Based Data Model Semi Structured Data Model XML etc. 5

6 Schema, Instance of Database
Database schema the description of the database is called the database schema or intension; specified at the creation of the database not expected to change very often Database instance the raw data that populates a database at a particular moment in time is called a database instance of the extension of the database 6

7 Initial Database State:
Refers to the content of a database at a moment in time. Initial Database State: Refers to the database state when it is initially loaded into the system. Valid State: A state that satisfies the structure and constraints of the database. 7

8 Schema and Instance - Example
8

9 Three Level Architecture
Also, called three-schema architecture Internal Level – Storage Level External Level – User Logical Level Conceptual Level – Community Logical Level 9

10 Three Level Architecture
10

11 Three Level Architecture
Objectives All users should be able to access same data. A user’s view is immune to changes made in other views. Users should not need to know physical database storage details. 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. 11

12 Three Level Architecture
It is a Description of Data, Actual Data stored in Database Visualize the Schema in Database Each group refers to its Own Schema only External Schema and Conceptual Schema are described at same level in DBMS. Oracle, MS Sql Server uses SQL for this purpose. 12

13 Three Level Architecture
13

14 External Level Used to Model the view of Database for Users according to their requirement. Same data in the Database but Different representation at User End. Different Formats of data Standardized organizational calculation performed on data Statistically analyzed view of the data. 14

15 External Level Created for different users to maintain data integrity and Security. Identical to User Access of Data, Reports required by Particular User and Data Modification permission. Enhanced over the period of time as requirement change in the organization. 15

16 Conceptual Level Purpose
Provide description of information of interest to the organization. Provide stable platform to which both Internal and External Schemas may be bound. It has capability to enhance or modify external views, Changes at internal level shall not be visible to external level also. Provide a mechanism to maintain control over the content and use of database 16

17 Conceptual Level An abstract view of entire schema.
Also called community User View. It is the view of entire database as seen by the Designer and DBA. It contains the definitions of the data. 17

18 Conceptual Level Same data, different names
The DBMS ties it all together 18

19 Conceptual Level Contains Semantic information about the real world
Contains, Entities, Attributes, Types of Attributes and Relationships. Comprehensive design that caters present and future need of the organization. 19

20 Conceptual Level 20

21 Internal Level The Internal schema describes details of how data is stored: files, indices, etc. on the random access disk system.  It also typically describes the record layout of files and type of files (hash, b-tree, flat). Data is stored as Stored Records It describes the “machine view” of the data as bits and bytes. Early applications worked at this level - explicitly dealt with details. E.g., minimizing physical distances between related data and organizing the data structures within the file (blocked records, linked lists of blocks, etc.) Physical and Logical Access Paths are defined at Internal level. Logical Access paths – Partitioning and Materialization Physical Access Paths – Indices etc. Describes Data is encoded, stored and accessed in the database. 21

22 Different Levels of Three Schema Architecture
22

23 Different Levels of Three Schema Architecture
23

24 Mapping 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. It also helps to make applications independent from storage of data. 24

25 data catalogue/dictionary  schemas  mappings
Schemas and Mapping schemas external conceptual internal mappings external / conceptual conceptual / internal data catalogue/dictionary  schemas  mappings 25

26 External/ Conceptual Mapping- Example
26

27 Conceptual/ Internal Mapping- Example
27

28 Data Independence When a schema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas. 28

29 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 29

30 Physical Data Independence:
The DBMS maps data access between the conceptual to physical schemas automatically. Physical schema can be changed without changing application: DBMS must change mapping from conceptual to physical. 30

31 The higher-level schemas themselves are unchanged.
Data Independence When a schema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas. 31

32 Data Independence and Mapping
32

33 SQL (Structured Query Language)
33

34 ???????????????? 34


Download ppt "Database Systems Instructor Name: Lecture-3."

Similar presentations


Ads by Google