Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
第一章 資料庫系統基本觀念 1 章節概覽 1. 何謂資料庫系統 2. 資料庫種類 3. 關連式資料的架構與特性 4. 資料庫系統的網路架構 5. 資料庫管理系統的議題 6. 結構化查詢語言 Structure Query Language, SQL 7. 資料庫系統的角色關係 2 1.1何謂資料庫系統 資料庫系統( Database System) 二項要素: 資料庫(Database) A collection of data stored in a standardized format, designed to be shared by multiple users. 資料庫管理系統 (Database Management System) Software that defines a database, stores the data, supports a query language, produces reports, and creates data entry screens. 3 Database 人事資料庫 產品資料庫 銷售資料庫 DBMS 4 DBMS: Microsoft SQL Server Oracle Informix IBM DB2 Microsoft Access Many limited PC (dBASE, Paradox, …) 5 1.2 資料庫種類 資料庫系統分別為: 階層式資料庫(Hierarchical Database) 網路式資料庫(Network Database) 物件導向資料庫(Object-Oriented Database) 關連式資料庫(Relational Database) 6 階層式資料庫(Hierarchical Database) 最早發展的資料庫架構 恆逸資訊 張智凱 專長 35歲 SQL Server 楊先民 專長 樹狀 結構 處長 蘇國林 楊先民 30歲 SQL Server MFC 著作 30歲 實戰 Pocket PC程式設計 Pocket PC程式設計自學手冊 SQL Server程式設計 缺點: 1.資料橫向關係難以建立 2.資料重覆存取 7 網路式資料庫(Network Database) 網路式資料庫,主要將變動項目抽出 P609 實戰Pocket PC程式設計 420 P646 Pocket PC程式設計自學手冊 550 學貫出版社 楊先民 P666 SQL Server實務規劃 650 F120 SQL Server效能控制 0 SQL Server電子雜誌 8 物件導向資料庫(Object-Oriented Database) 物件導向資料庫: 是一種新的資料庫架構 利用物件導向方法設計資料庫 每個東西都是物件 具有繼承、封裝以及多型的觀念 資料庫物件的再利用性提高 物件導向式資料庫 = 物件導向 + 資料庫的能力 9 關連式資料庫(Relational Database) 資料儲存在資料表中,每個資料表彼此都有關連: 訂單編號 員工編號 訂單日期 K01 E01 2002/10/30 P01 K02 E01 2002/11/30 P02 K03 E02 2002/11/11 P03 員工編號 員工姓名 員工年齡 員工薪水 E01 楊先民 30 40000 E02 張智凱 35 55000 E03 張書源 31 46000 產品編號 產品編號 產品名稱 產品價格 產品庫存 P01 綠油精 50 20 P02 白花油 45 25 P03 正露丸 110 12 10 1.3 關連式資料庫的架構與特性 依照資料庫的特性,將資料存到資料表(Table) 資料表是由欄位(Column or Field)與列所組合 列(Row)又稱為記錄(Record) 不要輸入重覆的資料列 欄位沒有給予值時,可以填入NULL值 11 NULL值的定義 NULL 是代表0 ? NULL 是代表空白 ? NULL 是 1. 代表無意義的資料或 2. 表示沒有輸入的資料 3. 由系統主動產生的,不是直接輸入NULL 4. NULL值不會列入函數計算中 查詢資料時,不能用=NULL將資料取出,要用 IS NULL 12 1.4 資料庫系統的網路架構 單機環境 大型主機架構 主從式架構 分散式架構 13 單機環境 一部電腦負責所有資料庫 資料筆數不多 工作性質單純 以檔案型的資料庫為主 14 大型主機架構 利用一台大型主機負責儲存與處理龐大的資料 大型主機本身運算能力,處理資料能力強 大型主機本身的造價相當昂貴 大型主機系統封閉 15 主從式架構 將兩台電腦串連起來之後,只要由前端電腦連接到 資料庫伺服器端,就可以存取資料庫的內容 16 分散式架構 分散式架構是延續主從式架構的精神所產生出來的 架構 17 1.5 資料庫管理系統的議題 資料庫與資料表定義 資料查詢與處理 資料的安全性 資料的備份 與異質資料庫的整合 18 1.6 何謂結構化查詢語言 SQL SQL是 Structure Query Language的縮寫 對關連式資料庫裡的資料加以定義、修改以及控 制的語言標準 SQL Server的 SQL語法: [範例]: CREATE TABLE SalaryLevel ( Lowbound decimal(7,2) NOT NULL, Highbound decimal(7,2) NOT NULL, Salelevel varchar(50) NOT NULL ) 19 1.7 資料庫系統的角色關係 資料庫設計者 Database Designer 系統分析師 System Analyzer 資料庫管理者 Database Administrator , DBA 程式設計師 System Developer , Programmer 一般使用者 End User 20 建立系統:可行性評估 Costs Up-front/one-time Software ($ millions !) Hardware Communications Data conversion Studies and Design Training On-going costs Personnel Software upgrades Supplies Support Software & Hardware maintenance Benefits Cost Savings Software maintenance Fewer errors Less data maintenance Less user training Increased Value Better access to data Better decisions Better communication More timely reports Faster reaction to change New products & services Strategic Advantages Lock out competitors 21 學習成果 資料庫系統包括資料庫及資料庫管理系統 資料庫有階層式、網路式、關連式以及物件導向式 的資料庫 資料庫的網路架構主要有大型主機架構、單機架構 、主從式架構與分散式架構 資料庫議題依照工作特性可以分為資料庫設計者、 資料庫管理者、程式設計師與一般使用者 22 THANKS