DB Lecture 3: Database System Concepts and Architecture PDF
Document Details
Uploaded by AdoredCharoite5407
2023
Dr. Manal Abdel-Kader Abdel-Fattah
Tags
Summary
This document provides lecture notes on database system concepts and architecture. It covers topics such as data models, schemas, data abstraction, and different types of data models (conceptual, high-level, low-level).
Full Transcript
10/16/2024 Lecture 3 Database System Concepts and Architecture © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.1 1 Lecture objectives 1. Data Models, Schemas, and Instances 2. Three-Schema Architecture and Data Independence ©...
10/16/2024 Lecture 3 Database System Concepts and Architecture © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.1 1 Lecture objectives 1. Data Models, Schemas, and Instances 2. Three-Schema Architecture and Data Independence © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.2 2 1 10/16/2024 1. Data Models, Schemas, and Instances ❖ Data abstraction ❖ Suppression of details of data organization and storage. ❖ Highlighting of the essential features for an improved understanding of data. ❖ Different users can perceive data at their preferred level of detail. © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.3 3 Data Models, Schemas, and Instances (cont'd.) ❖ Data model ❖ Collection of concepts that describe the structure of a database (data types, relationships, constraints) ❖ Provides means to achieve data abstraction ❖ Basic operations Specify retrievals and updates on the database © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.4 4 2 10/16/2024 Categories of Data Models ❖ Data Models categorize according to the types of concepts they use to describe the database structure ❖ High-level or conceptual data models ❖ Close to the way many users perceive data. ❖ Low-level or physical data models ❖ Describe the details of how data is stored on computer storage media (Hard Disk). ❖ Representational data models ❖ Easily understood by end users ❖ Similar to how data organized in computer storage © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.5 5 Categories of Data Models (cont'd.) Conceptual data models ❖ Entity ❖ Represents a real-world object or concept ❖ Attribute ❖ Represents some property of interest ❖ Further describes an entity ❖ Relationship among two or more entities ❖ Represents an association among the entities ❖ Entity-Relationship model © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.6 6 3 10/16/2024 Entity-Relationship model EID Name EMPLOYEE Phone Name PROJECT WorksOn Budget StartDate © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.7 7 Categories of Data Models (cont'd.) ❖ Representational or implementation data models ❖ Used most frequently in traditional commercial DBMSs ❖ These include the widely used relational data model ❖ the network and hierarchical models that have been widely used in the past © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.8 8 4 10/16/2024 Relational data model © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.9 9 Categories of Data Models (cont'd.) ❖ Physical data models ❖ Describe how data is stored as files in the computer ❖ typically only of interest to database designers, implementers and maintainers …not end users ❖ 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 © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.10 10 5 10/16/2024 Schemas, Instances, and Database State ❖ Database schema ❖ Description of a database ❖ Schema diagram ❖ Displays selected aspects of schema, Most data models have certain conventions for displaying schemas as diagrams.7 A displayed schema is called a schema diagram ❖ Schema construct ❖ Each object in the schema ❖ Database state or snapshot ❖ Data in database at a particular moment in time ❖ It is also called the current set of occurrences or instances in the database © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.11 11 Schemas, Instances, and Database State (cont'd.) Schema diagram for the database The diagram displays the structure of each record type but not the actual instances of records © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.12 12 6 10/16/2024 2. Three-Schema Architecture and Data Independence ❖ The goal of the three-schema architecture is to separate the user applications from the physical database. ❖ Internal level ❖ Describes physical storage structure of the database. ❖ Conceptual level ❖ Describes structure of the whole database for a community of users (entities, data types, relationships, user operations, and constraints). ❖ External or view level ❖ includes a number of external schemas or user views ❖ Describes part of the database that a particular user group is interested in. © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.13 13 Three-Schema Architecture and Data Independence (cont'd.) © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.14 14 7 10/16/2024 Mapping the Data Models to the Three- Schema Architecture Conceptual Relational High-level level/schema data models Internal Physical Low-level level/schema data models External Representational Conceptual level/view data models data models ERD © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.15 15 Three-Schema Architecture and Data Independence (cont'd.) © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.16 16 8 10/16/2024 Three-Schema Architecture and Data Independence (cont'd.) Implemented using a representational data model use generic view representational data model use physical view physical Low level data model © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.17 17 Data Independence ❖ Capacity to change the schema at one level of a database system without having to change the schema at the next higher level. Logical the capacity to change the conceptual schema without having to change external schemas or application programs. For example, we may change the conceptual schema to expand the database (by adding a record type or data item), to change constraints, or to reduce the database (by removing a record type or data item). © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.18 18 9 10/16/2024 Data Independence (cont'd.) © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.19 19 Data Independence (cont'd.) Physical the capacity to change the internal schema without having to change the conceptual schema. by creating additional access structures—to improve the performance of retrieval or update. If the same data as before remains in the database, we should not have to change the conceptual schema. For example, providing an access path to improve retrieval speed of section records. © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.20 20 10 10/16/2024 Data Independence (summary) ❖ logical data independence ❖ ensures that changes to the conceptual schema don't affect the external views ❖ This is not always achievable. ❖ physical data independence ❖ conceptual and external schema are defined in terms of the data model, rather than the actual data layout. ❖ ensures that conceptual and external schemas are not affected by changes to the physical data layout. © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.21 21 Thank you © 2023 by Dr. Manal Abdel-Kader Abdel-Fattah 3.22 22 11