Database System Concepts-2023

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Database System Concepts

& Architecture

Wen-Chih Peng
Covid-19

• Something about Covid 2019


• 鍵盤救國
https://www.businessweekly.
com.tw/focus/blog/3001698
• 口罩地圖
https://mask.pdis.nat.gov.tw
• 類流感分析
https://fluforecast.cdc.gov.tw
• Novel Corona Virus 2019
Dataset
ANSI-SPARC Three-Level Architecture

3
Examples of Three Levels of ANSI-SPARC
Architecture

4
Data Independence and the ANSI-SPARC
Three-Level Architecture

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

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

7
Categories of Data Models

Conceptual
Data Models

Implementation
Data Models

Physical
Data Models
Data Model
• Data abstraction: hiding details of data storage that are not needed by most
DB users
• Data model
• Provides the necessary means to achieve data abstraction
• A collection of concepts that can be used to describe the structure of a
DB
• Structure: data types, relationships & constraints on data
• a set of basic operators on data
• Concepts to specify dynamic aspect or behavior of a DB application
• Allows DB designer to specify a set of valid user defined operators.
Categories of Data Models
• Categorized according to types of concepts
• High level data model
• Conceptual data model
• Provide concepts that are close to the way users perceive data
• Low level data model
• Physical data model
• Provides concept that describe the details of how data is stored in the computer
• Meant for computer specialists, not for typical end users
• Representational data model
• Implementation data models
• Provide concepts that maybe understood by end users but that are not far
removed from the way data is organized with the computer
• Hide some details of data storage but can be implemented on a computer system
in direct way
Conceptual Data Models

Conceptual data model uses


• Entity
• a real world object or concept
• Attribute
• property of interest that further describes an entity
• Relationship
• represents an interaction among the entities

Example of conceptual data model


• Entity-Relationship model (ER model)
An Example Conceptual Data Model
Implementation Data Model

Implementation data model Examples of implementation data


model
represents data by using record structures relational data model
record-based data models network data model
hierarchical data model
object data model (closer to conceptual data model)
An Example Conceptual Data Model
An Example of Data Model

員工編號 姓名 講授科目
060302 曹孝櫟 C001
060301 吳毅成 C004 課程編號 課程名稱 時間
060306 李毅郎 C002
C001 作業系統 星期四
060309 黃俊龍 C003
C002 計算機組織 星期三
060308 彭文志 C005
C003 編譯器 星期一
C004 演算法 星期二
C005 資料庫系統 星期五
員工編號 使用課本
060301 Operating Systems
060302 Algorithms
060306 Computer Architecture
060309 Compiler Design
060308 Database Systems
Relational
Data Model
Physical Data Model
• Physical data model
• describe how data is stored in the computer
• record formats, record ordering, access paths
Schema
• Database schema
• description of a database
• specified during database design
• is not expected to change frequently
• Schema evolution: schema change
• Intension of the schema
• Schema diagram: a displayed schema
• Schema construct: object in the schema
• Metadata (data about data) = schema + constraints
• DBMS stores metadata in the DBMS catalog (data dictionary)
An Example of Schema
Database State

Data in the DB at a particular moment in


Database state time
Current set of occurrences or instances in
(snapshot) the DB
Extension of schema

is responsible for ensuring valid state

DBMS Valid state: a states that satisfies the


structure & constraints specified in the
schema
Components of Database Manager

21
DBMS Languages

DBMS Languages

• DDL (data definition language): conceptual schema


• SDL (storage definition language): internal schema
• VDL (view definition language): view schema
• DML (data manipulation language)

SQL = DDL+ VDL + DML + constraints + schema


evolution
Types of DML
• Types of DML
• High level DML
• nonprocedural, declarative
• specifies which data to be retrieved
• interactive or embedded in high level programming language
• e.g. C + SQL, Visual BASIC +SQL
• set-at-a-time
• Low level DML
• Procedural
• specifies how data to be retrieved
• record-at-time
Host
Language
• Host language
• high level programming
language to embed DML
• Data sublanguage
(embedded language)
• DML embedded in host
language
• Query language
• High level DML used in a
interactive maner
Graphical user interfaces

• Displays a schema to users in


diagrammatic form

DBMS • Users specify query by


manipulating diagram

Interfaces Natural language interfaces

Interfaces for DBA


• Database utilities
• help DBA in managing the DB system

Database • Types of functions


• Loading

System • Loading text files into DB


• Conversion tools

Utilities • Backup
• Incremental backup
• File organization
• Performance monitoring
Self-Study
• Something about Convid 2019
• 鍵盤救國https://www.businessweekly.com.tw/focus/blog/3001698
• 口罩地圖 https://mask.pdis.nat.gov.tw
• 類流感分析 https://fluforecast.cdc.gov.tw
• Novel Corona Virus 2019 Dataset
• Program languages
• ASP, php, python ?
• Web interface
• Databases
• MySQL, MS SQL, cloud DB, Big Query ?

You might also like