an overview of database management. an example a database system –a computerized record-keeping...

23
An Overview of Database Management

Upload: collin-flynn

Post on 28-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

An Overview of Database Management

Page 2: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

An Example

• A database system– A computerized record-keeping system

• Database– A repository for a collection of computerized data fi

les– A kind of electronic filing cabinet

• Tables, records, SQL• Operations

– Add, insert, retrieve, update, delete, remove※Repository: 저장소 , operation: 연산

Page 3: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

The wine cellar database

Page 4: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Retrieval 검색

SELECT WINE, BIN#, PRODUCER

FROM CELLARWHERE

READY=2000;WINE BIN# PRODUCE

R

Cab.Sanvignon 43 Windsor

Pinot Noir 51 Stemmler

Merlot 58 Clos Du Bois

Page 5: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Insert, update, delete 삽입 , 갱신 , 삭제

INSERT INTO CELLAR(BIN#, WINE, PRODUCER, YEAR, BOTTLES, READY)VALUES(53, ‘Pinot Noir’, ‘Saintsbury’, 1997, 6, 2001)

UPDATE CELLARSET BOTTLES =4WHERE BIN# = 3;

DELETEFROM CELLARWHERE BIN# = 2;

Page 6: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

What is a database system?

• Database system– A computerized record-keeping system– Components

• Data• H/W• S/W• Users

※Record-keeping: 기록유지관리

Page 7: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Data in database system

• Integrated– Unification of several distinct filesEx) student files, book files

• Shared– Being shared among different users with dif

ferent purposesEx) book tables among students and librarian

s※Integrated: 통합된 , Shared: 공유된

Page 8: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

H/W in database system

• Secondary storage devices – disk• Processor(s) and main memory to suppo

rt the execution of the database system S/W

• ※secondary storage device: 이차저장장치

Page 9: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

S/W in database system

• DBMS(database management system)– Also known as

• database manager• Database server

– The shielding of database users from hardware-level details

• Ex) Microsoft ACCESS, Microsoft SQL Server, MySQL, ORACLE, DB2, SQLite…

• ※shield: 방패

Page 10: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Users in database system

• Application programmers– Write database application programs in some

programming language such as C, C++, Java, Visual Basic, COBOL, …

• End users– Use the system online thru interface– Interface

• Built-in query language processor– Command-driven interfaces– Menu- or forms-driven interfaces

• DBA (database administrator)– Creates and maintains database

Page 11: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

What is a database?

• Database– A collection of shared persistent data used

by the application systems of some particular enterprise

– Persistent data• Data that live long time• Differ from short-lived data like input data, outp

ut data, intermediate results---transient in nature

• ※intermediate: 중간의

Page 12: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Example

• A manufacturing company – product data

• A bank – account data• A hospital – patient data• A university – student data• A government department –

planning data

Page 13: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Entities and relationships 개체 , 관계성

• A medium to represent database for an enterprise conceptually.

• Entities– Independent, distinguishable objects

• Relationship– Unary – Binary– Ternary※unary: 일진 , Binary: 이진 , ternary: 삼진

Page 14: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Example of E/R

• A manufacturing company: KnowWare Inc.– Wants to record data about

• The projects on hand• The parts used in the projects• The suppliers who supply the parts• The warehouses in which those parts are stored• The employees who work on the projects entities

Page 15: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Example of E/R• There are relationships linking entities - bidirectional • SP (suppliers and parts)

– Each supplier supplies certain parts– Each part is supplied by certain suppliers

• PJ (projects and parts)– Parts are used in projects– Projects use parts

• WP (warehouse and parts)– Parts are stored in warehouses– Warehouses store parts

※Bidirectional: 양방향의

Page 16: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Ex) SP relationship*given a supplier, get the parts supplied by that supplier*given a part, get the suppliers who supply that part

• Entity/relationship diagram (E/R diagram for short)

Page 17: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Properties

• Entities and relationships can be regarded as having properties corresponding to the data we wish to record about them

• Ex) suppliers: name, city, …

※property: 특성

Page 18: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Why database?• Advantages over paper-based method of record ke

eping– Compactness

• No need for voluminous paper files– Speed– Less drudgery

• Elimination of maintaining files by hand – Currency

• Accurate, up-to-date information– Centralized control in multi-user environment

※drudgery: 힘들고 반복적인 일 , currency: 최신

Page 19: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Benefits of database

• Data sharing– Not only existing applications but also new applicat

ions• Reduction of redundancy

– Integration by DBA– Controlled redundancy

• Avoidance of inconsistency– Corollary of reduction of redundancy

※Redundancy: 중복성 , corollary: 계 , 당연한 결론

Page 20: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Benefits of database

• Transaction support– Transaction: a logical unit of work– Ex) transfer of money from account A to B

• Account A and B have to be updated• What if crash occurs before update of account

B?

※crash: 시스템 고장

Page 21: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Benefits of database

• Integrity– Data in the database is accurate

• Security– Having the complete jurisdiction over the data by D

BA• Ensure proper channels to access DB• Define security rules for sensitive data (read, write, modif

y)

※integrity: 무결성 , jurisdiction: 관할권

Page 22: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Benefits of database

• Balancing conflicting requirements– Ex) Internal storage method of data

• For fast access for the most important applications : eg. Index structure

• slower access for certain other applications : eg. sequential file structure

• Standards– Representation of data– Aid to data interchange or migration between syste

ms※sequential file: 순차파일

Page 23: An Overview of Database Management. An Example A database system –A computerized record-keeping system Database –A repository for a collection of computerized

Benefits of database

• Data independence– Separation of physical and logical aspect of

database– DBA can change physical storage structure

and access strategy without having to modify existing applications

※access-strategy: 액세스방법