Introduction to database technology (Based on Chapters 1-2 in Fundamentals of Database Systems by...

40
Introduction to database technology (Based on Chapters 1-2 in Fundamentals of Database Systems by Elmasri and Navathe, Ed. 4)

Transcript of Introduction to database technology (Based on Chapters 1-2 in Fundamentals of Database Systems by...

Introduction to database technology

(Based on Chapters 1-2 in Fundamentals of Database Systems

by Elmasri and Navathe, Ed. 4)

Introduction to Database Systems

2

outline1 Basic Definitions2 Example of a

Database3 Data Models

3A. History of data Models

3B. Network Data Model

3C. Hierarchical Data Model

1 Basic Definitions2 Example of a

Database3 Data Models

3A. History of data Models

3B. Network Data Model

3C. Hierarchical Data Model

4 Schemas versus Instances

5 DBMS Languages6 DBMS Interfaces7 DBMS Component

Modules8 Database System

Utilities9 Classification of

DBMSs

4 Schemas versus Instances

5 DBMS Languages6 DBMS Interfaces7 DBMS Component

Modules8 Database System

Utilities9 Classification of

DBMSs

Introduction to Database Systems

3

1 名詞定義 Database :

A collection of related data. Data :

Known facts that can be recorded and have an implicit meaning.

Introduction to Database Systems

4

Database Management System (DBMS) :

資料庫管理系統 A software package/ system to

facilitate( 幫忙 ) the creation and maintenance of a computerized database.

Introduction to Database Systems

5

Database System : ( 資料庫系統 ) The DBMS software together with the

data itself. Sometimes, the applications are also

included.

Database System = Data + DBMS + (Program)

Database System = Data + DBMS + (Program)

Introduction to Database Systems

6

INSERT FIGURE 1.1

Introduction to Database Systems

7

Basic Definitions Mini-world( 給定資料庫一個應用範圍 )

Some part of the real world about which data is stored in a database.

For example, student grades and transcripts at a university.

Introduction to Database Systems

8

2. Example of a Database(with a Conceptual Data Model)  

Mini-world example: Part of a UNIVERSITY environment.

Entities( 實體 , 東西 ) Relationships( 關係 )

Introduction to Database Systems

9

Some mini-world entities: STUDENTs COURSEs SECTIONs (of COURSEs) (academic) DEPARTMENTs INSTRUCTORs

Introduction to Database Systems

10

Some mini-world relationships: SECTIONs are of specific COURSEs STUDENTs take SECTIONs COURSEs have prerequisite COURSEs INSTRUCTORs teach SECTIONs COURSEs are offered by DEPARTMENTs STUDENTs major in DEPARTMENTs

Introduction to Database Systems

11

NOTE: The above could be expressed in

the ENTITY-RELATIONSHIP data model.

Introduction to Database Systems

12

6. 名詞定義 Data Model: (資料模式 )

A set of concepts to describe the structure of a database, and certain constraints that the database should obey. ( 結構 )

Data Model: (資料模式 ) A set of concepts to describe the

structure of a database, and certain constraints that the database should obey. ( 結構 )

Introduction to Database Systems

13

Operations for specifying database retrievals and updates by referring to the concepts of the data model.( 資料處理動作 )

Introduction to Database Systems

14

Categories of data models: Conceptual data models ( 概念模式 )

(high-level, semantic 語意 ) Physical data models( 實體模式 , 儲存

模式 ) (low-level, internal)

Implementation data models ( 建置模式 ) (record-oriented)

Introduction to Database Systems

15

Conceptual data models: Provide concepts that are close to

the way many users perceive data.

( Examples : entity-relationship or object-based data models.)

Introduction to Database Systems

16

Physical data models: Provide concepts that describe

details of how data is stored( 儲存 ) in the computer. storage structure Access path( 幫助存取的結構 , 索引 )

Introduction to Database Systems

17

Implementation data models: Also called logical data model Provide concepts that fall between

the above two, balancing user views with some computer storage details.

Introduction to Database Systems

18

6A. HISTORY OF DATA MODELS

Relational Model( 關連式 ) Network Model( 網路式 ) Hierarchical Data Model( 階層式 ) Object-oriented Data Model( 物件導

向 ) Object-Relational Model( 物件關連

式 )

Introduction to Database Systems

19

Relational Model: proposed in 1970 by E.F. Codd (IBM),

first commercial system in 1981-82. Now in several commercial products

ORACLE, SQL Server INFORMIX, DB2 SYBASE,

Introduction to Database Systems

20

Network Model: the first one to be implemented by

Honeywell in 1964-65 (IDS System).

Adopted heavily due to the support by CODASYL (CODASYL - DBTG report of 1971).

Introduction to Database Systems

21

Hierarchical Data Model : implemented in a joint effort by

IBM and North American Rockwell around 1965.

Resulted in the IMS family of systems.

The most popular model.

Introduction to Database Systems

22

Object-oriented Data Models : several models have been proposed for

implementing in a database system. One set comprises models of persistent

O-O Programming Languages such as C++ (e.g., in ObjectStore or

VERSANT), and Smalltalk (e.g., in GEMSTONE).

Additionally, systems like O2, ORION (at MCC - then ITASCA), IRIS (at H.P.- used in Open OODB).

Introduction to Database Systems

23

Object-Relational Models : Most Recent Trend. Exemplified( 範例 ) in Uni-SQL

systems,ORACLE

Introduction to Database Systems

24

7. Schemas( 綱要 ) versus Instances (個例 ) Database Schema :

The description of a database. Includes

descriptions of the database structure and the constraints that should hold on the

database. Schema Diagram:

A diagrammatic display of (some aspects of) a database schema.

Introduction to Database Systems

25

Introduction to Database Systems

26

Database Instance : The actual data stored in a database

at a particular moment in time . ( 儲存的資料 )

Also called database state (or occurrence).

Introduction to Database Systems

27

Introduction to Database Systems

28

The database schema changes very infrequently .

The database state changes every time the database is updated .

Schema is also called intension, whereas state is called extension.

Introduction to Database Systems

29

10. DBMS Languages Data Definition Language (DDL) Data Manipulation Language (DML) Data Control Language (DCL)

Introduction to Database Systems

30

Data Definition Language (DDL): Used by the DBA and database

designers to specify the conceptual schema of a database.

In many DBMSs, the DDL is also used to define internal and external schemas (views).

Introduction to Database Systems

31

Data Manipulation Language (DML): Used to specify database retrievals

and updates. DML commands (data sublanguage) can

be embedded in a general-purpose programming language (host language), such as C, COBOL, PL/1 or PASCAL.

Alternatively, stand-alone DML commands can be applied directly (query language).

Introduction to Database Systems

32

11. DBMS Interfaces Stand-alone query language

interfaces. Programmer interfaces for embedding

DML in programming languages: Pre-compiler Approach(Embedded

SQL) Procedure (Subroutine) Call

Approach(CLI)

Introduction to Database Systems

33

Interfaces for the DBA: Creating accounts, granting

authorizations Setting system parameters Changing schemas or access path

Introduction to Database Systems

34

Introduction to Database Systems

35

13. Database System Utilities To perform certain functions such as:

Loading data stored in files into a database. Backing up the database periodically on

tape. Reorganizing database file structures. Report generation utilities. Performance monitoring utilities. Other functions, such as sorting , user

monitoring , data compression , etc.

Introduction to Database Systems

36

Data dictionary / repository: Used to store schema descriptions

and other information such as design decisions, application program descriptions, user information, usage standards, etc.

Introduction to Database Systems

37

14. 資料庫管理系統的分類 Based on data model Other classifications

Introduction to Database Systems

38

根據資料模式 : Traditional:

Relational, Network, Hierarchical. Object-Relational

Emerging: XML.

Introduction to Database Systems

39

其他它分類 : Single-user (typically used with micro-

computers) vs. multi-user (most DBMSs). Centralized (uses a single computer with

one database) vs. distributed (uses multiple computers, multiple databases) Distributed Database Systems have now come

to be known as client server based database systems because they do not support a totally distributed environment, but rather a set of database servers supporting a set of clients.

Introduction to Database Systems

40

Distributed Database Systems have now come to be known as client server based database systems because they do not support a totally distributed environment, but rather a set of database servers supporting a set of clients.