Download presentation
Presentation is loading. Please wait.
Published byShauna Lindsey Modified over 8 years ago
1
1 Database Design Chapter-2- Database System Concepts and Architecture Reference: Prof. Mona Mursi Lecture notes
2
2 Architecture Evolution DBMS was a tightly integrated system DBMS now is modular in design with client- server architecture Mainframes replaced by hundreds of distributed computers connected by a network
3
3 Client–Server Architecture Client 1 Client 2 LAN Server (DBMS) Database Client Module Run on user computer Application programs & user interface that access DB Handles user interaction and supports GUI Server Module Handles data storage. Access, search.. ect
4
4 Data Model Data Abstraction : hiding details of data storage that are not needed by most DB users. Data Model: a collection of concepts used to describe the structure of the DB and a set of operations for specifying retrieval and updates of the DB. DB Structure : Data types Relationships Constraints
5
5 Categories of Data Models High Level (Conceptual Data Model) Representational (implementation Data Model) Low Level (Physical Data Model) Provides concepts close to the way Many users see data Provides concepts may be understood by end users but are not far from the way the data is organized. (Entities, Attributes, Relationships) Relational Data Model widely used Details of how data is stored in the computer. (Computer specialist) (representing Records format, ordering, access paths : makes the search for a record more efficient)
6
6 Representational (implementation Data Model) Entity: Represent a real-world objects or concepts. (ex: employee) Attribute: Represent some property of interest that describes an entity. (ex: salary, name) Relationship: among two or more entities. (ex: a works-on relationship between an employee and a project)
7
7 Database Schema
8
8 What is DB Schema? A description of the database Not changed frequently Specify when a new database defined Schema constructs: Objects in schema (STUDENT or COURSE ) Schema diagram : Convention to display the structure of each record but not the actual instance
9
9 Schema Diagram STUDENT COURSE Name Student_Number Class Major C_Name C_Number CreditHours Department Note: Schema diagram displays only some aspects of a schema. Ex: does not show the data types nor the relationship between files. Schema Construct
10
10 Instances and Schema Name Account Number Balance Layla102850 Maha5291933 Schema Instances The data stored In the database at any given time The overall design Of the DB
11
11 Example: University Database DB Schema A DB Instance Schema Constructs
12
12 Database systems have schemas at each level of abstraction : Physical Level Conceptual Level View 1View 2View 3View N …….. Physical Schema (files of records or structs) ONLY ONE SCHEMA Conceptual Schema Ex: name, account, balance ONLY ONE SCHEMA Subschema Part of the schema Controls what info can be seen AS MANY AS NEEDED
13
13 Database State Database state : the data in the database at particular moment in time Every insert, delete, update will change the database state. Important difference between database state and database schema: Define a new DB => specify Database schema to the DBMS, At this point the database state is “empty state”. Database is populated or loaded with data => database state changes. At any time there is a current database state.
14
14 Database State Valid state: every state of the database satisfies the structure and constraints specified in the schema. The DBMS stores the structure and constraints (meta- data) in the DBMS catalog. Schema Evolution : adding another data item to the schema. Ex: adding dateofbirth to the student schema.
15
15 Three - Schema Architecture
16
16 DBMS Architecture and Data Independence Characteristics of database approach: 1. Insulation of program and data (program- data and program-operation independence) 2. Support of multiple user views 3. Use of catalog To achieve the previous characteristics => three schema architecture was proposed.
17
17 Visualization of Three-Schema Architecture
18
18 Three-Schema Architecture Internal level: describes how data is stored. The way perceived by the DBMS & OS. Conceptual level: describes what data stored in DB, and the relationships among the data. The way perceived by the DBA & programmers. External level: describes the part of the DB that user is interested in. The way perceived by the end users.
19
19 Three-Schema Architecture Emp_No FName LName Dept_NoStaff_No LName Salary View 1 View 2 Internal Level Conceptual Level EMPLOYEE Emp_NoCHAR(6) FNameCHAR(15) LNameCHAR(15) Dept_NoCHAR(3) SalaryNUMBER(5) PREFIXTYPE=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 External Level
20
20 Mapping Mapping is the process of transforming requests and results between the Internal, Conceptual & External levels. Two types of mapping: - External / Conceptual mapping -Conceptual / Internal mapping
21
21 Data Independence
22
22 Data Independence Data independence: is the ability to modify a schema definition in one level without affecting a schema definition in the next higher level. Two levels of data independence: 1. Logical data independence 2. Physical data independence
23
23 Internal Schema Conceptual Schema External Schema External Schema External Schema External/Conceptual Mapping Conceptual/Internal Mapping Logical data Independence Physical data Independence Data Independence
24
24 1- Logical data independence The ability to change the conceptual schema without affecting the external schemas. (application programs) Ex: adding/ removing a record or a data item The external schema that refer to the remaining data should not be affected.
25
25 2- Physical data independence The ability to change the internal schema without affecting the conceptual or external schemas. This change might be for reorganizing the physical files. EX: creating new access structures to improve the performance of retrieval or update.
26
26 Database Languages
27
27 Purpose of a Database Language DDL (Data Definition Languages) Conceptual schema Internal schemas External schema SDL (Store Definition Languages) Internal schema VDL (View Definition Languages) External view DML (Data Manipulation Languages) To manipulate the populated data A comprehensive database language is the SQl which represent a combination of DDL,VDL and DML
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.