版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Department of computer science & technology NJUST,Database Systems數(shù)據(jù)庫(kù)系統(tǒng),Database Systems,2.5學(xué)分上課、 0.5學(xué)分上機(jī) ,共3學(xué)分。 學(xué)習(xí)目的:掌握數(shù)據(jù)庫(kù)系統(tǒng)的基本概念、原理和方法;學(xué)會(huì)有效地使用數(shù)據(jù)庫(kù)管理系統(tǒng),完成數(shù)據(jù)庫(kù)的設(shè)計(jì)和對(duì)數(shù)據(jù)庫(kù)的編程。 學(xué)習(xí)方法:理論結(jié)合實(shí)踐。 考核方式及要求:作業(yè)(20%):按時(shí)認(rèn)真完成作業(yè)。
2、實(shí)驗(yàn)(10%):完成上機(jī)實(shí)驗(yàn)并提交實(shí)驗(yàn)報(bào)告。閉卷考試(70%):英文試卷。,,,Database Systems,Reference booksJeffrey D.Ullman, Jennifer Widom. 數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)教程(原書第3版). 岳麗華等譯. 機(jī)械工業(yè)出版社. 2009.Abraham Silberschatz, Henry F.Korth, S.Sudarshan. Database System Conce
3、pts (Fourth Edition). 機(jī)械工業(yè)出版社. http://www-db.stanford.edu/~ullman/fcdb.html,,,The Worlds of Database SystemThe Relational Model of Data*Design Theory for Relational DatabasesHigh-Level Database ModelsAlgebraic and
4、Logical Query Language *The Database Language SQLConstraints and TriggersViews and IndexesSQL in a Server EnvironmentAdvanced topics in Relational Databases,A First Course in Database Systems,,,1 The Worlds of Data
5、base Systems,,,The Evolution of Database Systems Overview of a DBMS Outline of Database-System Studies,1.1 The Evolution of Database Systems,,,What’s a database?In essence, a database is a collection of information t
6、hat exists over a long period of time, often many years.In common parlance(說法), a database is a collection of data that is managed by a database management system (DBMS).,1.1 The Evolution of Database Systems,,,Database
7、 Applications:Banking: all transactions(交易)Airlines: reservations(預(yù)定), schedules(航班表)Universities: registration, gradesSales: customers, products, ordersManufacturing: production, inventory(庫(kù)存), orders, supply chai
8、nHuman resources: employee records, salaries, tax deductions Databases touch all aspects of our lives.,1.1 The Evolution of Database Systems,,,A DBMS is expected to:Data Definition Language (DDL): create databases
9、 and specify their schema(模式). A schema is a group of collections of sentences that are expressed by DDL to describe the logical structure of the database completely.Data Query Language and Data Manipulation Lang
10、uage: query(查詢) and modify(更新) the data based on the schema of the database.Support the storage of very large amounts of data: many terabytes(1012 bytes) or more, over a long period of time, allowing efficient access.,1
11、.1 The Evolution of Database Systems,,,A DBMS is expected to:Enable durability(持久): the recovery of the database in the face of failures(故障), errors of many kinds, or intentional misuse.Support Data sharing(共享): contro
12、l access to data from many users at once; without allowing the action of one user to affect other users(isolation 隔離性); without actions on the data to be performed partially but not completely(atomicity 原子性).,1.1 The Evo
13、lution of Database Systems,,,Database systems evolved from file systems.,Data redundancy(冗余) and inconsistencyMultiple file formats, duplication of information in different files.Difficulty in accessing data Need to w
14、rite a new program to carry out each new task.,1.1 The Evolution of Database Systems,,,Database systems evolved from file systems.,Integrity(完整性) problemsIntegrity constraints(約束) (e.g. account balance > 0) become “
15、buried(埋入)” in program code rather than being stated explicitly(明確地).Hard to add new constraints or change existing ones.Atomicity of updatesFailures(故障) may leave database in an inconsistent state with partial update
16、s carried out.Example: Transfer of funds(資金) from one account to another should either complete or not happen at all.,1.1 The Evolution of Database Systems,,,Database systems evolved from file systems.,Concurrent(并發(fā)) ac
17、cess by multiple usersUncontrolled concurrent accesses can lead to inconsistencies.Example: Two people reading a balance and updating it at the same time.Security problemsHard to provide user access to some, but not
18、all, data.,1.1 The Evolution of Database Systems,,,Late 1960s and 1970s:Hard disks allow direct access to dataNetwork and hierarchical data models in widespread useThe early DBMS didn't support high-level
19、query languages.,1.1 The Evolution of Database Systems,,,1970:Ted Codd defines the relational data modelReceived the ACM Turing Award in 1981IBM Research begins System R prototypeMain idea: organize all the data in d
20、atabase as tables called relations.Queries could be expressed in a very high-level language to increase the efficiency of database programmers.,1.1 The Evolution of Database Systems,,,1980s:Research relat
21、ional prototypes evolve into commercial(商用的) systemsSQL becomes industrial standardParallel and distributed(分布式) database systemsObject-oriented database systems,1990s:Large decision support and data-mining(數(shù)據(jù)挖掘) app
22、licationsLarge multi-terabyte data warehouses(數(shù)據(jù)倉(cāng)庫(kù))Emergence(出現(xiàn)) of Web commerce(商務(wù)),2000s:XML(可擴(kuò)展模型語(yǔ)言) and XQuery standards,1.2 Overview of a Database Management System,,,A DBMS is a powerful tool for creating and ma
23、naging large amounts of data efficiently and allowing it to persist over long periods of time, safely.,1.2 Overview of a Database Management System,,,,1.2 Overview of a Database Management System,,,Application 1,Applicat
24、ion 2,...,Application n,DBMS,,,,database,,Database Management System,,單線框 系統(tǒng)成分雙線框 內(nèi)存中的數(shù)據(jù)結(jié)構(gòu)實(shí)線 控制和數(shù)據(jù)流虛線 數(shù)據(jù)流,1.2 Overview of a Database Management System,,,Two types of user:Conventional users and applic
25、ation programs.A database administrator(DBA): a person or persons responsible for the structure or schema of the database.Three kinds of commands to the DBMS:Queries , updates : commands to affect the content of the
26、database or extract(提取) data from the database. Transaction commands: commands to tell the transaction manager when transactions begin and end.DDL commands: commands to change the schema of the database or create a new
27、 database by DBA.,1.2 Overview of a Database Management System,,,Storage and buffer manager: includes the storage manager and the buffer manager:storage manager: controls the placement of data on disk and its movement
28、between disk and main memory, keeps track(跟蹤) of the location of files on the disk and obtains the block or blocks containing a file on request from the buffer manager.buffer manager: partition(分割) the available main m
29、emory into buffers.,1.2 Overview of a Database Management System,,,The kinds of information:Data: the contents of the database itself.Metadata(元數(shù)據(jù)): the database schema(模式) that describes the structure of, and constrai
30、nts(約束) on, the database.Indexes(索引): data structures that support efficient access to the data.Statistics(統(tǒng)計(jì)): information gathered and stored by the DBMS about data properties.Log(日志) records: information about rece
31、nt changes to the database, these support durability(持久性) of the database.,單線框 系統(tǒng)成分雙線框 內(nèi)存中的數(shù)據(jù)結(jié)構(gòu)實(shí)線 控制和數(shù)據(jù)流虛線 數(shù)據(jù)流,1.2 Overview of a Database Management System,,,Transaction Processing:Transaction(事務(wù)): a gr
32、oup of operations that must appear to have been executed together sequentially, as a unit.Transaction manager: Concurrency-control(并發(fā)控制) manager, or scheduler(調(diào)度器): responsible for assuring atomcity(原子性) and isolation
33、(隔離性) of transactions. Lock.Logging and recovery manager: responsible for the durability(持久性) of transactions. Logging.,1.2 Overview of a Database Management System,,,Properties: ACIDAtomicity: either all of a tra
34、nsaction be executed or none of it is.Consistency(一致性): keep consistent state.Isolation(隔離性): When two or more transactions run concurrently, their effects must be isolated from one another.Durability(持久性): If a trans
35、action has completed its work, its effect should not get lost while the system fail, even if it fails immediately after the transaction completes.,1.2 Overview of a Database Management System,,,Query processor:Query com
36、piler(編譯器): Translates the query into an internal form called a query plan. Query parser(分析器): build a tree structure. Query preprocessor(預(yù)處理器): perform the initial query plan Query optimizer(優(yōu)化器):Execution engine: I
37、t executes each of the steps in the chosen query plan. It gets the data from the database into buffers in order to manipulate that data. It needs to interact(交流) with the scheduler(調(diào)度器) to avoid accessing data that is lo
38、cked, and with the log manager to make sure that all database changes are properly logged.,單線框 系統(tǒng)成分雙線框 內(nèi)存中的數(shù)據(jù)結(jié)構(gòu)實(shí)線 控制和數(shù)據(jù)流虛線 數(shù)據(jù)流,1.2 Overview of a Database Management System,,,Client/Server (C/S) architect
39、ure,,DB Client,,DB Client,DB Server,JavaC/C++PowerBuilderDelphiVB…,MS AccessMS SQL ServerSybase MySQLOracleIBM DB2…,Client: the process sending queries or other commands.Server: the process executing queries
40、or other commands,1.3 Outline of Database-System Studies,,,Three types of ideas related to database systems:Design:How to build a useful database? Requirement analysis, data modeling, relational modeling.Programming:
41、How to express queries and other operations on database? Iimplementation:How to build a DBMS?,1.3.1 Database Design,,,Chapter 2, 3 and 4 cover design. Chapter 2: The Relational Model of DataChapter 3: Design Theory f
42、or Relational DatabasesChapter 4: High-Level Database Models,1.3.2 Database Programming,,,Chapter 5 through 10 cover database programming.Chapters 5: Algebraic and Logical Query Language Chapters 6: The Database Langu
43、age SQLChapters 7: Constraints and TriggersChapters 8: Views and IndexesChapters 9: SQL in a Server EnvironmentChapters 10: Advanced topics in Relational Databases,1.3.3 An example of database application,,,We'll
44、 build a marketing database system for a sale company. It will manage all the following information: 1. Manage all department information in the company (such as “Shanghai sale department”, “JiangSu sale depar
45、tment”). Also manage every salesman information in those departments including exclusive(唯一的) employee number, ID card number, and some private information (such as name, gender, birthday and phone number). By the way on
46、e of salesmen will act as the department manager in his department.,1.3.3 An example of database application,,,2. Manage a group of customers: name, province(省), city, company name, phone number. 3.Manage all the pro
47、duct information: manufacturers (e.g. Chunlan, Hailer ), types (e.g. motorcycle, air conditioner ), specifications (e.g. "MT125", "RE1500" ), prices, descriptions. 4. Manage sales order whic
48、h record each deal(交易) has been done. Notes: every sales order contains an unique order No. , sign date, a corresponding customer, a salesman, and at least one kind of products. Any product in the order should have
49、its quantity and unit price which will be used to calculate the total prices.,,,為某商品銷售公司構(gòu)作一個(gè)銷售業(yè)務(wù)數(shù)據(jù)庫(kù)系統(tǒng),該系統(tǒng)至少應(yīng)管理以下內(nèi)容:公司分為多個(gè)下屬部門(Department),如“江蘇銷售部”,“上海銷售部”等。每個(gè)部門有若干銷售員(Salesman),每個(gè)銷售員有唯一的員工號(hào)(如“S0025”)和身份證號(hào),也包含姓名、性別、出生日期、
50、電話等信息。一個(gè)銷售員僅屬于一個(gè)部門,且每個(gè)部門有一個(gè)銷售員擔(dān)任部門經(jīng)理。 。 系統(tǒng)應(yīng)管理客戶信息(Customer),包含:名稱、省、市、單位名稱、電話等。 系統(tǒng)應(yīng)管理所有銷售的商品(Product):制造商(如“春蘭”、“海爾”)、種類(如“摩托車”、“空調(diào)機(jī)”)、規(guī)格(如“MT125”型摩托車、“RE1500”型空調(diào))、價(jià)格、功能及性能描述。 該系統(tǒng)用銷售訂單(Sales order)表示銷售業(yè)務(wù)。每個(gè)訂單有一個(gè)訂單號(hào)和簽訂
51、日期,且對(duì)應(yīng)一個(gè)客戶和一個(gè)銷售員。一個(gè)訂單至少銷售一種產(chǎn)品,并可銷售多種產(chǎn)品,且每種產(chǎn)品應(yīng)確定其銷售數(shù)量和單價(jià),以計(jì)算銷售金額。,1.3.3 An example of database application,Entity/Relationship Model,1.3.3 An example of database application,,,Relational Data Model:Customer (custid
52、, name, prov, city, phone, unit)Product (prodid, factory, type, spec, price, desc)Salesman (empid, idno, name, gender, phone, deptid)Department (deptid, name, headerid)Salesorder (orderno, signdate, empid, custid)Sa
53、lesitem (orderno, lineno, prodid, singlecost, quantity),1.3.3 An example of database application,,,relational algebra expressions:1 Find the IDs and phone numbers of all salesmen named “張平”. Пempid,phone(σname=‘張平
54、' (Salesman))2 Find the names and phone numbers of all customers who have transacted(交易) with the salesman whose ID is “E0056”. Пname,phone(σempid='E0056' (Salesorder Customer)),relational opera
55、tions by SQL:1 Find the IDs and phone numbers of all salesmen named “張平”. SELECT empid, phone FROM salesman WHERE name = ‘張平';2 Find the names and phone numbers of all customers who have transacted
56、(交易) with the salesman whose ID is “E0056”. SELECT name, phone FROM salesorder NATURAL JOIN customer WHERE empid = 'E0056';,Database Systems,作業(yè):,,,閱讀第1章。通過上網(wǎng)或其它途徑查閱資料,了解數(shù)據(jù)庫(kù)的概念,數(shù)據(jù)庫(kù)技術(shù)的發(fā)展與現(xiàn)狀,并詳細(xì)了解一個(gè)庫(kù)存
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)教程第三章答案
- 數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)教程第四章答案
- 數(shù)據(jù)庫(kù)技術(shù)基礎(chǔ)教程
- 數(shù)據(jù)庫(kù)應(yīng)用基礎(chǔ)教程
- 南京理工大學(xué)《數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)教程》試題和答案
- 41 數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)
- 《數(shù)據(jù)庫(kù)系統(tǒng)原理教程》復(fù)習(xí)重點(diǎn)
- 第 1 章 數(shù)據(jù)庫(kù)系統(tǒng)基礎(chǔ)知識(shí)
- 數(shù)據(jù)庫(kù)系統(tǒng)原理教程課后習(xí)題答案
- 《數(shù)據(jù)庫(kù)系統(tǒng)原理教程》復(fù)習(xí)重點(diǎn)(new)
- 《數(shù)據(jù)庫(kù)系統(tǒng)教程》試卷(b卷,20051)
- database systems(資料庫(kù)系統(tǒng))
- oracle11g數(shù)據(jù)庫(kù)基礎(chǔ)教程課后習(xí)題答案
- oracle11g數(shù)據(jù)庫(kù)基礎(chǔ)教程課后習(xí)題答案
- 數(shù)據(jù)庫(kù)系統(tǒng)講義
- 數(shù)據(jù)庫(kù)系統(tǒng)講義
- 數(shù)據(jù)庫(kù)系統(tǒng)概論
- 外文翻譯----數(shù)據(jù)庫(kù)和數(shù)據(jù)庫(kù)系統(tǒng)
- 數(shù)據(jù)庫(kù)系統(tǒng)教程習(xí)題答案(施伯樂)(第版)數(shù)據(jù)庫(kù)原理及應(yīng)用
- access(數(shù)據(jù)庫(kù)系統(tǒng)概述)
評(píng)論
0/150
提交評(píng)論