1 / 15

Chapter 2

Chapter 2. Database System Concepts and Architecture. Outline. Data Models and Their Categories Schemas, Instances, and States Three-Schema Architecture DBMS Languages. Data Models.

vala
Download Presentation

Chapter 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 Database System Concepts and Architecture

  2. Outline • Data Models and Their Categories • Schemas, Instances, and States • Three-Schema Architecture • DBMS Languages

  3. Data Models • Data Model: A set of concepts to describe the structure of a database,and certain constraints that the database should obey. • Data Model Operations: Operations for specifying database retrievals and updates by referring to the concepts of the data model.

  4. Categories of data models • Conceptual (high-level, semantic) data models: Provide concepts that are close to the way many users perceive data. • Physical (low-level, internal) data models: Provide concepts that describe details of how data is stored in the computer. • Implementation (representational) data models: Provide concepts that fall between the above two, balancing user views with some computer storage details.

  5. Schemas versus Instances • Database Schema: The description of a database. Includes descriptions of the database structure, data types, and the constraints that should hold on the database. • Schema Diagram: A diagrammatic display of (some aspects of) a database schema. • Schema Construct: A component of the schema or an object within the schema, e.g., STUDENT, COURSE. • Database Instance (database state ): The actual data stored in a database at a particular moment in time. This includes the collection of all the data in the database. Also called snapshot or occurrence.

  6. Schema Diagram for the database. Schema Construct

  7. Example of a database state

  8. Database Schema Vs. Database State Database State: Refers to the content of a database at a moment in time. • Empty State: After specified database schema to the DBMS, the database state is the empty state with no data • 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. • Current State: at any point in time, the database has a current state.

  9. Database Schema Vs. Database State Distinction • The database schema changes very infrequently. • The database state changes every time the database is updated. Schema is also called intension State is also called extension

  10. Three-Schema Architecture Defines DBMS schemas at three levels: • Internal schema at the internal level to describe physical storage structures and access paths. The way perceived by the DBMS & OS. • Typically uses a physical data model. • Conceptual schema at the conceptual level to describe the structure and constraints for the whole database for a community of users. The way perceived by the DBA & programmers. • Uses a conceptual or an implementation data model. • External schemas at the external level to describe the various user views. The way perceived by the end users. • Usually uses the same data model as the conceptual schema.

  11. Three-Schema Architecture View 2 View 1 External Level Emp_No FName LName Dept_No Staff_No LName Salary EMPLOYEE Emp_No CHAR(6) FName CHAR(15) LName CHAR(15) Dept_No CHAR(3) Salary NUMBER(5) Conceptual Level PREFIX TYPE=BYTE(6),OFFSET=0 EMP# TYPE=BYTE(6),OFFSET=6, INDEX=EMPX LNM TYPE=BYTE(15),OFFSET=12 FNM TYPE=BYTE(15),OFFSET=27 DPT# TYPE=BYTE(4),OFFSET=42 PAY TYPE=FULLWORD,OFFSET=46 Internal Level

  12. Three-Schema Architecture • 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. • Data extracted from the internal DBMS level is reformatted to match the user’s external view (e.g. formatting the results of an SQL query for display in a Web page) Two types of mapping: • External / Conceptual mapping • Conceptual / Internal mapping

  13. External Schema External Schema External Schema External/Conceptual Mapping Conceptual Schema Conceptual/Internal Mapping Internal Schema

  14. DBMS Languages • Data Definition Language (DDL): Used by the DBA and database designers to specify the schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). • Data Manipulation Language (DML): Used to specify database retrievals and updates. Two types of DML: • High Level or Non-procedural Languages: e.g., SQL, are set-oriented and user specify what data is required without specify how to get those data. Also called declarative languages. • Low Level or Procedural Languages: record-at-a-time; they specify how to retrieve data and include constructs such as looping.

More Related