Upload
harold-griffith
View
223
Download
3
Embed Size (px)
Citation preview
Ch.1 Database System 데이터베이스시스템 2
What to Learn Database System Overview Entity-Relationship diagram Relational Data Model
Structure & Constraints SQL language
How to use Commercial DBMS’s MS Access MS SQL Server
Normalization ( 정규화 ) Transaction & Concurrency ( 동시성 )
Ch.1 Database System 데이터베이스시스템 3
What to Learn Database and Database system Modeling a real world
Conceptual Modeling Data Modeling Data Structuring
File processing system Advantages of database system
Ch.1 Database System 데이터베이스시스템 4
What to Learn Components of a Database system
Database Software (DBMS) Users
Application Programmers, End users, DBA's Hardware (computer)
ANSI database architecture Various types of database system
Central vs. distributed systems Client/server system
Ch.1 Database System 데이터베이스시스템 5
Components of a database sys-tem Database
A collection of data to store Software
Database management system (DBMS) Handles all the access to the database
Hardware Computers and hard disks
Users Application programmer End user Database administrator (DBA)
Ch.1 Database System 데이터베이스시스템 6
components of a database sys-tem
Real World
system boundary
E-R diagram
conceptualmodeling
logical schema(conceptual view)
physical schema(internal view)
stored database
Operatingsystem
DBMS DDL
DML
view view view
External view
Ch.1 Database System 데이터베이스시스템 7
1. Database Logical database
NAME ST_NO ADDRESS DEPT GRADE
송치윤 52015 사당동 컴퓨터 3.3
김구완 53116 홍제동 정보통신 3.1
최재석 56034 양재동 정보관리 3.5
Field, Column, Attribute Record, Row, Tuple File, Table, Relation Record type, Table heading, Relation schema (type) Records, Table body, Relation instance (state)
Physical database Data dictionary (system catalog)
Ch.1 Database System 데이터베이스시스템 8
2. Software (DBMS) (1)shielding database users from hard-ware-level details
Functions of DBMS Data definition
Save the schema in the data dictionaryschema detailed definition of the overall database de-signlogical schema, physical schema,external/conceptual mapping, (p.48) conceptual/internal mappingData definition language (DDL) (p.41)
Ch.1 Database System 데이터베이스시스템 9
components of a database sys-tem
Real World
system boundary
E-R diagram
conceptualmodeling
logical schema(conceptual view)
physical schema(internal view)
stored database
Operatingsystem
DBMS DDL
DML
view view view
External view
Ch.1 Database System 데이터베이스시스템 10
2. Software (DBMS) (2) Data manipulation
Data manipulation language (DML, 데이터 조작어 ) (p.42)
Retrieve, Select ( 검색 ), Insert ( 삽입 ), Delete ( 삭제 ),Update ( 수정 )
Other functions Query optimization ( 질의 최적화 ) Concurrency control ( 동시성 제어 ) Recovery ( 복구 ) Security ( 보안 ) Integrity ( 무결성 )
Ch.1 Database System 데이터베이스시스템 11
2. Software (DBMS) (3) Example of query optimization
Students(St_No, Name, Year), 10,000 rowsEnroll(St_No, Subject, Grade) 50,000 rows
Select the enrollment state of first year students.
1) match Student and Enroll tables 50,000 rows select first year students 12,500 rows
2) select first year strudents 2,500 rows match Student and Enroll tables 12,500 rows
Ch.1 Database System 데이터베이스시스템 12
2. Software (DBMS) (4) Example of concurrency control
Sales(Prod_No, sale_amount), current value = 30Agent A sold 30, Agent B sold 20The correct value should be 30+30+20 = 80
1) Agent A reads the current value 30, calculates 30+30 Agent B reads the current value 30, calculates
30+20 Agent A updates the record to 60, Agent B updates the record to 50. The sale of 30
is lost.
2) Agent A requests a lock, and reads 30, calculates 30+30
Agent B requests a lock, but waits until the lock is released.
Agent A updates the record to 60, releases the lock
Agent B gets a lock, and reads 60, calculates 60+20
Agent B updates the record to 80, releases the lock
Ch.1 Database System 데이터베이스시스템 14
3. Users (1) Application programmers
write database application programs in general programming language
host language : general programming language like C++, Visual Basic, C#, Java
embedded language : the language used to send DML to a DBMS
End usersad hoc (unplanned) query user : use a program with which a user
directly send DML command to DBMScanned (planned) query user ; use an easy-to-use program which
was developed by application programmers
Database Administrator (DBA)responsible for the overall control of the database system at a
technical level c.f. : data administrator
Ch.1 Database System 데이터베이스시스템 16
3. Users (3) DBA’s tasks
Define the logical schema Define the physical schema Define security and integrity constraints Define backup/recovery policies Assist users : provide technical education,
analyze the information requirements of users,
consult application design balance conflicting user requirements
Monitor performance and respond to changing requirements
Ch.1 Database System 데이터베이스시스템 17
Goals of database systems Reduce redundancy through integration Sharing Standardization Enhance security and integrity Data independence Data abstraction
Ch.1 Database System 데이터베이스시스템 18
Goals of database systems Data independence
Immunity of applications to change in physical represen-tation and access technique
Possible changes in data representationnumbers (real, integer, fixed, floating point)
remember Y2k problemcharacters (ASCII, Unicode)coding system (M or F, 0 or 1)changes in record structure
product(Prod_No, Prod_Name, cost, price,monthlyproduction, monthlysales)
Data abstraction Easy to use (do not worry about physical structures)
select Prod_Name, price, monthlysales from prod-uct;