Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Database Environment Pearson Education © 2009.

Similar presentations


Presentation on theme: "Chapter 2 Database Environment Pearson Education © 2009."— Presentation transcript:

1 Chapter 2 Database Environment Pearson Education © 2009

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. Pearson Education © 2009

3 The Three-Level ANSI-SPARC Architecture
ANSI-SPARC stands for (American National Standards Institute, Standards Planning And Requirements Committee) is an abstract design standard for a Database Management System (DBMS) Pearson Education © 2009

4 ANSI-SPARC Three-Level Architecture
Pearson Education © 2009

5 Objectives of Three-Level Architecture
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. Pearson Education © 2009

6 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. Pearson Education © 2009

7 ANSI-SPARC Three-Level Architecture
External Level Users’ view of the database. Describes that part of database that is relevant to a particular user. Conceptual Level Community view of the database. Describes what data is stored in database and relationships among the data. Pearson Education © 2009

8 ANSI-SPARC Three-Level Architecture
Internal Level Physical representation of the database on the computer. Describes how the data is stored in the database. Pearson Education © 2009

9 Differences between Three Levels
Pearson Education © 2009

10 Schemas, Mappings, and Instances
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.

11 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.

12 Example Schema Instance

13 Data Independence Means : upper levels are unaffected by changes to lower levels. Two kinds of data independence: logical and physical. Pearson Education © 2009

14 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. Pearson Education © 2009

15 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. Pearson Education © 2009

16 Data Independence and the ANSI-SPARC Three-Level Architecture
Pearson Education © 2009

17 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 (describes objects in database and make it easier for manipulation) that is stored in the data dictionary. Pearson Education © 2009

18 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. It is called Query language. Types of DML: Low level or Procedural Language: user specifies what data is required and how to get those data(allows user to tell system exactly how to manipulate data.) It is embedded in a high-level languages. High level or Nonprocedural Language: 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.). It is called declarative languages, such as SQL. Fourth Generation Languages (4GLs) e.g., SQL, Form generators, and Report generators Pearson Education © 2009

19 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. Pearson Education © 2009

20 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 C,C++,Lisp,.. Application Program Call to DB DBMS Local Vars (memory) Pearson Education © 2009

21 Data Model Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization. Data Model comprises three components: a structural part (set of rules according to which databases can be constructed). a manipulative part (defines the types of operation that are allowed on the data). possibly a set of integrity rules (which ensure that the data is accurate). Pearson Education © 2009

22 Data Model Purpose To represent data in an understandable way.
Categories of data models include: Object-based (Use concepts such as entities, attributes and relationships) Record-based (use a number of fixed-format record) Physical (how data stored such as record structures ordering and access paths) Conceptual (heart of database) Pearson Education © 2009

23 Data Models Types of Object-Based Data Models are:
Entity-Relationship Semantic Functional Object-Oriented. Types of Record-Based Data Models are: Relational Data Model Network Data Model Hierarchical Data Model. Physical Data Models : describe how data is stored in the computer Pearson Education © 2009

24 Record-Based Data Models Relational Data Model
Data and relationships as tables Pearson Education © 2009

25 Record-Based Data Models Network Data Model
Data as records and relationships as sets Pearson Education © 2009

26 Record-Based Data Models Hierarchical Data Model
Data as records and relationships as sets Pearson Education © 2009

27 Conceptual Modeling Conceptual schema is the core of a system supporting all user views. Should be complete and accurate representation of an organization’s data requirements. Conceptual modeling is process of developing a model of information use that is independent of implementation details. Result is a conceptual data model. Pearson Education © 2009

28 Functions of a DBMS Data Storage, Retrieval, and Update: the ability to store, retrieve and update data in the database. A User-Accessible Catalog: catalog, which describes the data items, should be accessible to users. Transaction Support: ensure that either all the updates corresponding to a given transaction are made or none of them is made. Concurrency Control Services: database updated correctly when multiple users are updating the database concurrently. Recovery Services: recovering for the database in the event that it is damaged Pearson Education © 2009

29 Functions of a DBMS Authorization Services: only authorized users can access the database. Integrity Services: ensure that both data in the database and changes are following certain rules. Support for data communication: capable of integrating with communication software. Services to Promote Data Independence: support independence of programs from actual structure of the database. Utility Services. Import and export facilities monitoring facilities ,.. etc. Pearson Education © 2009


Download ppt "Chapter 2 Database Environment Pearson Education © 2009."

Similar presentations


Ads by Google