introduction to database

25
Introduction to database 黃黃黃

Upload: rianne

Post on 04-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Introduction to database. 黃獻華. Outline. 資料 vs. 資訊 何謂資料庫與其特性 介紹關聯式 資料庫 系統 簡單介紹 SQL 的語法 應用方面 Data mining References. 資料 vs. 資訊. 資料. 資訊. 資料 (data) : 實際儲存且未經過處理的值 資訊 (information): 已經過處理的且對使用者有意義的值. 什麼是資料庫 (database)?. 可視為一種電子化的檔案櫃 - 儲存電腦化資料檔的處所 相關資料的收集處所. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to database

Introduction to database

黃獻華

Page 2: Introduction to database

Outline

資料 vs. 資訊 何謂資料庫與其特性 介紹關聯式資料庫系統 簡單介紹 SQL 的語法 應用方面 Data mining References

Page 3: Introduction to database

資料 vs. 資訊

資料 (data) : 實際儲存且未經過處理的值

資訊 (information): 已經過處理的且對使用者有意義的值

資料 資訊

Page 4: Introduction to database

什麼是資料庫 (database)?

可視為一種電子化的檔案櫃 - 儲存電腦化資料檔的處所

相關資料的收集處所

科目 學號 成績資結 22334 90

資結 51211 54

電網導 51211 87

電網導 22336 85

… … …

Page 5: Introduction to database

資料庫系統 (Database system)

使用者 (user) 軟體 (software) – datab

ase management system (DBMS)

硬體 (hardware) 資料 (data)

Page 6: Introduction to database

了解資料庫管理系統 (DBMS)

處理所有對資料庫存取的軟體

應用程式SQLcommands

DBMS

資料庫

Page 7: Introduction to database

資料庫特性

長存資料 實體與關係 性質 (property)

實體

jbs 住在 Chapel Hill

性質

Page 8: Introduction to database

為何使用資料庫

簡潔 (compactness) 訊速 (speed) 節省人力 (less drudgery) 即時性 (currency) 可以減少重複 可以避免不一致 資料獨立於程式之外 資料可以共用 安全性限制

你看 , 有多方便啊 !

Page 9: Introduction to database

網頁搜尋系統 - Google

Page 10: Introduction to database

認識關聯式資料庫系統 (Relational Databases)

Page 11: Introduction to database

關聯式資料庫系統 (Relational Databases) 今日主流 關聯性 (relation) 資料都是表格 從舊表格產生新的表格 橫列 (columns) : attribut

es 直行 (rows): 實體 (entiti

es) Superkey

學號 姓名 科系 年齡

22334 王 XX 電機 20

22336 陳 XX 電機 19

51211 張 XX 資工 20

… … … …

科目 學號 成績

資結 22334 90

資結 51211 54

電網導 51211 87

電網導 22336 85

… … …

Page 12: Introduction to database

Name ssn strAddr City State Zip Salary

jbs 010-00-1111 Sitterson Hall

Chapel Hill NC 27599 120000

lkb 037-84-7667 32 Juniper Rd

Bethel CT 06801 100000

橫列子集

Name State Zip

jbs NC 120000

wms NY 60000

lkb CT 100000

dkb RI 30000

jbs PU 1000

直行子集

SQL command

Attribute

Entity

關聯式例子 : wms 住在 Binghampton

Page 13: Introduction to database

資料庫語言

一個關聯資料庫需要以下的操作 查詢資料 改變資料:新增,刪除,更新等 控制資料:使用者權限,確定資料變更等

那就是要用 SQL 啦 !

Page 14: Introduction to database

認識 SQL 語法

處理關聯式資料庫的標準程式語言

Data definition language (DDL) – 資料庫管理員操作的

Data manipulation language (DML) – 終端使用者操作的

Page 15: Introduction to database

簡單的 SQL 指令 CREATE DATABASE databasename; USE databasename; CREATE TABLE Song (Title varchar(20) not null, Artist varchar(16) not null,

Album varchar(20), Time char(5) ); INSERT INTO Song VALUES ("Roundabout", "Yes", "Fragile", "9:35"); SELECT * from Song;

Title Artist Album Time

Roundabout Yes Fragile 9:35

Title Artist Album Time

Almost similar to English language

Page 16: Introduction to database

SQL 的使用方式

在線上直接輸入 SQL 指令

使用高階語言如 C/C++, Fortran, PHP 等呼叫 SQL

Page 17: Introduction to database

資料庫之應用

Oracle Informix Sybase Microsoft access Open source : PostgreSql and MySql

Page 18: Introduction to database

認識 Data Mining

Page 19: Introduction to database

全球資料成長率

全世界資料庫的資料量每 20 個月就增加一倍

很多大公司需要管理的資料量到達 terabytes(1012)

資訊量的成長速度遠超過人類的分析能力

Page 20: Introduction to database

為何用 Data Mining?

We are drowning in data, but starving for knowledge!

在龐大的資料中 , 可能隱藏了很多重要的知識

美國的一項研究報告更是將Data Mining 視為二十一世紀十大明星產業

Times 時代雜誌曾預估 :“Data Mining 將是 21 世紀最熱門之五大新興行業“

Page 21: Introduction to database

什麼是 Data Mining?在龐大的數據庫中尋找出有價值的隱藏事件 .

Page 22: Introduction to database

Data Mining 的工作循環 應用的領域包括金融業、保險業、零售業、直效行銷業、通訊業、制造業以及醫療服務業等。

Page 23: Introduction to database

www.amazon.com

Page 24: Introduction to database

可以預測

Page 25: Introduction to database

References

Data Management – Richard T. Watson A first course in database systems – Jeffrey

D. Ullman & Jennifer Widom 資料庫系統概論 – C.J. Date http://www.gss.com.tw/eis/12/datamini.htm