Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 2 Database Environment Pearson Education © 2009.

Similar presentations


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

1 1 Chapter 2 Database Environment Pearson Education © 2009

2 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal levels. u Purpose of external/conceptual and conceptual/internal mappings. u Meaning of logical and physical data independence. u Distinction between DDL and DML. u A classification of data models. Pearson Education © 2009

3 3 Chapter 2 - Objectives u Purpose/importance of conceptual modeling. u Typical functions and services a DBMS should provide. u Function and importance of system catalog. u Software components of a DBMS. u Meaning of client–server architecture and advantages of this type of architecture for a DBMS. u Function and uses of Transaction Processing Monitors. Pearson Education © 2009

4 4 Objectives of Three-Level Architecture u All users should be able to access same data. u A user’s view is immune to changes made in other views. u Users should not need to know physical database storage details. Pearson Education © 2009

5 5 Objectives of Three-Level Architecture u DBA should be able to change database storage structures without affecting the users’ views. u Internal structure of database should be unaffected by changes to physical aspects of storage. u DBA should be able to change conceptual structure of database without affecting all users. Pearson Education © 2009

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

7 7 ANSI-SPARC Three-Level Architecture u External Level –Users’ view of the database. –Describes that part of database that is relevant to a particular user. –Entities, attributes, relationships : user interested. u Conceptual Level –Community view of the database. –Describes what data is stored in database and relationships among the data. –Complete view of the data requirements of the organization: independentof any storage considerations –Supports external views Pearson Education © 2009

8 8 ANSI-SPARC Three-Level Architecture u Internal Level –Physical representation of the database on the computer. –Describes how the data is stored in the database. –Physical implementation of the database to achieve optimal runtime performance and storage utilization. Pearson Education © 2009

9 9 Differences between Three Levels of ANSI- SPARC Architecture Pearson Education © 2009

10 10 Differences between Three Levels of ANSI- SPARC Architecture Pearson Education © 2009 UNIVERSITY Conceptual Schema STUDENT (Name, Student Number, Class, Major) COURSE (Course Name, Course Number, Credit, Dept) PREREQUISITE (Course Number, Prerequisite Number) SECTION (Section Id, Course Number, Semester, Year, Instructor) GRADE_REPORT(Student Number, Section Id, Grade) UNIVERSITY External Schema TRANSCRIPT(Student Name, Course Number, Grade, Semester, Year, Section Id) derived from STUDENT, SECTION, GRADE_REPORT PREREQUISITES(Course Name, Course Number, Prerequisites) derived from PREREQUISITE, COURSE

11 ANSI-SPARC Three-Level Architecture: Schemas Pearson Education © 2009 u Overall description of the database: Database schema  specified during database design u 3 different types of schema: –External (subschemas) –Conceptual –Internal u Only 1 conceptual & internal schema

12 12 ANSI-SPARC Three-Level Architecture: Schemas Pearson Education © 2009

13 13 ANSI-SPARC Three-Level Architecture: Mappings u DBMS: –responsible for mapping between these schemas. –Check the schemas for consistency u Mappings: –Conceptual/Internal mapping »Enables DBMS to find the actual record/combinations of records in physical storage && any constraints –External/Conceptual mapping »Enables DBMS to map names in the user’s view to the relevant part of the conceptual schema Pearson Education © 2009

14 14 Data Independence u Major objective of the three-level architecture: provide data independence. u Two types: –Logical –Physical Pearson Education © 2009

15 15 Data Independence u Logical Data Independence –Refers to immunity of external schemas to changes in conceptual schema. –Conceptual schema changes (e.g. addition/removal of entities/attributes/relationships). –Should not require changes to external schema or rewrites of application programs. Pearson Education © 2009

16 16 Data Independence u 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

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

18 18 Database Languages u Data Definition Language (DDL) –Allows the DBA or user to describe and name entities, attributes, and relationships required for the application –plus any associated integrity and security constraints. Pearson Education © 2009

19 19 Database Languages u Data Manipulation Language (DML) –Provides basic data manipulation operations on data held in the database. u Procedural DML –allows user to tell system exactly how to manipulate data. u Non-Procedural DML –allows user to state what data is needed rather than how it is to be retrieved. u Fourth Generation Languages (4GLs) –nonprocedural Pearson Education © 2009

20 20 Database Languages u Fourth Generation Languages (4GLs) –Nonprocedural –Includes: »Presentation languages – query languages, report generators »Speciality languages – spreadsheets, database languages »Application generators that define insert, update, retrieve data from the database to build applications »Very high-level languages that are used too generate application code Pearson Education © 2009

21 21 Data Model u Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization. u Representation of real world objects and events and their association. u Represents the organization itself Pearson Education © 2009

22 22 Data Model Data Model comprises: –a structural part »a collection of data structures which are used to create databases representing the entities or objects modeled by the database. »A set of rules according to which databases can be constructed –a manipulative part »a collection of operators which can be applied to the data structures, to update and query the data contained in the database. »Defining the types of operation that are allowed on the data. –possibly a set of integrity rules »a collection of rules governing the constraints placed on these data structures to ensure structural integrity. »Ensures that the data is accurate Pearson Education © 2009

23 23 Data Model u Purpose –To represent data in an understandable way. –Can be used to design a database. u Categories of data models include: –Object-based –Record-based –Physical Pearson Education © 2009 Describe data at the conceptual & external levels Describe data at the internal level

24 24 Data Models: Object-Based Data Models u Use concept such as entities, attributes and relationships. u Some of the common types of object-based data model: –Entity-Relationship (ER) –Semantic –Functional –Object-Oriented. Pearson Education © 2009

25 25 Data Models: Record-Based Data Models u Database consists of a number of fixed-format records u Each record type defines a fixed number of fields – fixed length u Three types: –Relational Data Model –Network Data Model –Hierarchical Data Model. Pearson Education © 2009

26 26 Relational Data Model Pearson Education © 2009

27 27 Network Data Model Pearson Education © 2009

28 28 Hierarchical Data Model Pearson Education © 2009

29 29 Data Models: Physical Data Models u Describe how data is stored in the computer u Representing information such as record structures, record orderings and access paths. Pearson Education © 2009

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

31 31 Functions of a DBMS u Data Storage, Retrieval, and Update. –Fundamental capability of a DBMS –A DBMS must furnish users with the ability to store, retrieve and update data in the database u A User-Accessible Catalog. –A DBMS must furnish a catalog in which descriptions of data items are stored and which is accessible to users –System catalog stores: »Names, types and sizes of data items »Names of relationships »Integrity constraints »Names of authorized users »Data items that user can access and types of access allowed »External, conceptual and internal schemas and the mappings between the schemas »Usage statistics Pearson Education © 2009

32 32 Functions of a DBMS u Transaction Support. –A DBMS must furnish a mechanism that will ensure either that all the updates corresponding to a given transaction are made or that none of them is made u Concurrency Control Services. –A DBMS must furnish a mechanism to ensure that the database is updated correctly when multiple users are updating the database concurrently Pearson Education © 2009

33 33 Functions of a DBMS u Recovery Services. –A DBMS must furnish a mechanism for recovering the database in the event that the database is damaged in anyway. –Database has to be returned to a consistent state. u Authorization Services. –A DBMS must furnish a mechanism to ensure that only authorized users can access the database. u Support for Data Communication. –A DBMS must be capable of integrating with communication software. –DBMS should be capable to integrate with a variety of Data Communication Manager (DCM). Pearson Education © 2009

34 34 Functions of a DBMS u Integrity Services. –A DBMS must furnish a means to ensure that both the data in the database and changes to the data follow certain rules. –Database integrity: correctness and consistency of stored data. –Integrity: »Concerned with the quality of data. »Expressed in terms of constraints. u Services to Promote Data Independence. –A DBMS must include facilities to support the independence of programs from the actual structure of the database Pearson Education © 2009

35 35 Functions of a DBMS u Utility Services. –A DBMS should provide a set of utility services. –Help DBA administer the database effectively –Example: »Import/export facilities »Monitoring facilities »Statistical analysis programs »Index reorganization facilities Pearson Education © 2009

36 36 System Catalog u Repository of information (metadata) describing the data in the database. u One of the fundamental components of DBMS. u Typically stores: –names, types, and sizes of data items; –constraints on the data; –names of authorized users; –data items accessible by a user and the type of access; –usage statistics. Pearson Education © 2009


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

Similar presentations


Ads by Google