introduction to database management · pdf filedbms database application ... application...
TRANSCRIPT
การจดการฐานขอมล
Introduction to Database Management
Asst.Prof. Intiraporn Mulasastra
2
Outline
Database characteristics
DBMS features
Architectures
Organizational roles
Asst.Prof. Intiraporn Mulasastra
3
Initial Vocabulary
Data: raw facts about things and events
Information: transformed data that has value for decision making
Essential to organize data for retrieval and maintenance
Asst.Prof. Intiraporn Mulasastra
4
Database Characteristics
Persistent - Lasts a long time - Relevance of intended usage: only store
potentially relevant data Inter-related: - Entity: cluster of data about a topic (customer,
student, loan) - Relationship: connection among entities Shared: - Multiple uses: hundreds to thousands of data
entry screens and reports - Multiple users: many people simultaneously use
a database
Asst.Prof. Intiraporn Mulasastra
5
University Database
University Database
Registration
Grade
Recording
Faculty
Assignment
Course
Scheduling
Entities:
students, faculty, courses,
offerings, enrollments
Relationships:
faculty teach offerings,
students enroll in
offerings, offerings made
of courses, ...
Asst.Prof. Intiraporn Mulasastra
Electric Utility Database
Billing
Meter
Reading
Payment
Processing
Service Start/
Stop
Entities:
customers, meters, bil ls,
payments, meter readings
Relationships:
bi l ls sent to customers,
customers make payments,
customers use meters, ...
6 Asst.Prof. Intiraporn Mulasastra
7
Database Definition
Define database before using
Tables and relationships
SQL CREATE TABLE statement
Graphical tools
Asst.Prof. Intiraporn Mulasastra
8
A database : A self describing
collection of integrated records
1. A database is self describing
2. A database is a collection of integrated
records
Asst.Prof. Intiraporn Mulasastra
9
File
Bits bytes fields records files
Student Record •ID •FirstName •LastName
ID FirstNaทe LastName 101 ชาตไทย ใจด 102 สมศร สขสมร 103 มาด มสข 104 มานะ อดทน
Asst.Prof. Intiraporn Mulasastra
10
A database is a collection of integrated
records
Bits bytes fields records files + Metadata +
Indices +
Application
Metadata
Database
Bits bytes fields records files
Asst.Prof. Intiraporn Mulasastra
11
Entity Relationship Diagram
(University Database)
StdSSN
StdClass
StdMajor
StdGPA
Student
OfferNo
OffLocation
OffTime
Offering
EnrGrade
Enrollment
Registers
Accepts
CourseNo
CrsDesc
CrsUnits
Course
FacSSN
FacSalary
FacRank
FacHireDate
Faculty
Has
Teaches
Supervises
Asst.Prof. Intiraporn Mulasastra
12
University Database
Asst.Prof. Intiraporn Mulasastra
13
contain Data Dictionary (Metadata)
จดเกบโครงสรางของทกๆไฟล ในฐานขอมล
updated อตโนมตเมอแกไขโครงสรางไฟล
A database is self describing
โปรแกรมและฐานขอมลเปนอสระตอกน
Asst.Prof. Intiraporn Mulasastra
14
The Database
Electric User Data
ID FirstName LastName Address Province MeterNo
101 ชาตไทย ใจด 1/111 01 3815
102 สมศร สขสมร 355 01 3802
103 มาด มสข 2 ถ.ตก 22 4125
104 มานะ อดทน 155 22 4389
Asst.Prof. Intiraporn Mulasastra
15
• Metadata
Systables Table
Table Name Number of Columns Primary Keys
ElectricUser 6 ID
Province 3 Code
Syscolumns Table
Column Name Table Name DataType Length
ID ElectricUser Number 3
FirstName ElectricUser Text 25
…….
SysIndexes SysKeys SysProcedure SysUsers SysReference …. Asst.Prof. Intiraporn Mulasastra
16
• Indexes
Province Address
01 2,4
22 1,3
Province Index
ID FirstNmae LastName Address Province MeterNo
101 ชาตไทย ใจด 1/111 22 3815
102 สมศร สขสมร 355 01 3802
103 มาด มสข 2 ถ.ตก 22 4125
104 มานะ อดทน 155 01 4389
1
2
3
4
Record Address
ElectricUser Table
ID Address
101 1
102 2
103 3
104 4
ID Index
Asst.Prof. Intiraporn Mulasastra
17
• Application Metadata
stored procedure
query
form
report
Asst.Prof. Intiraporn Mulasastra
18
Data Independence
a database should have an identity separate from the applications
Software maintenance is a large part (50%) of information system budgets
Reduce impact of changes by separating database description from applications
Change database definition with minimal effect on applications that use the database
Asst.Prof. Intiraporn Mulasastra
19
Three Schema Architecture
View 1 View 2 View n
Conceptual
Schema
Internal
Schema
External
Level
Conceptual
Level
Internal
Level
External to
Conceptual
Mappings
Conceptual
to Internal
Mappings
Asst.Prof. Intiraporn Mulasastra
20
Differences among Levels
External FacultyAssignmentFormView: data required for
the form in (Figure 1.9)
FacultyWorkLoadReportView: data required for the report in (Figure 1.10)
Conceptual: tables in Slide 27 Internal
Files needed to store the tables
Extra files to improve performance
Asst.Prof. Intiraporn Mulasastra
21
Nonprocedural Access
Query: request for data to answer a question
Indicate what parts of database to retrieve not the procedural details
Improve productivity and improve accessibility
SQL SELECT statement and graphical tools
Loop
Asst.Prof. Intiraporn Mulasastra
22
Graphical Tool
for Nonprocedural Access
EnrGrade > 3.5
Asst.Prof. Intiraporn Mulasastra
23
Application Development
Form: formatted document for data entry and display
Report: formatted document for display
Use nonprocedural access to specify data requirements of forms and reports
Asst.Prof. Intiraporn Mulasastra
24
Sample Data Entry Form
Asst.Prof. Intiraporn Mulasastra
25
Sample Report
Asst.Prof. Intiraporn Mulasastra
26
Procedural Language Interface
Combine procedural language with nonprocedural access
Why
Batch processing
Customization and automation
Performance improvement
Asst.Prof. Intiraporn Mulasastra
27
Transaction Processing
Transaction: unit of work that should be reliably processed
Control simultaneous users
Recover from failures
Asst.Prof. Intiraporn Mulasastra
28
Database Technology Evolution
Era Generation Orientation Major Features
1960s 1st Generation File File structures and
proprietary program
interfaces
1970s 2nd Generation Network
Navigation
Networks and hierarchies
of related records,
standard program
interfaces
1980s 3rd Generation Relational Non-procedural
languages, optimization,
transaction processing
1990s 4th Generation Object Multi-media, active,
distributed processing,
more powerful operators
Asst.Prof. Intiraporn Mulasastra
29
database DBMS
Application ฝาก/ถอนเงน
Application เงนก
ระบบฐานขอมล
Asst.Prof. Intiraporn Mulasastra
30
การตดตอกบฐานขอมล
Database
Applications DBMS Database
Query Tools
ผใชทวไป โปรแกรมประยกต โปรแกรมระบบ
ผใชทมความร database
เครองมอจดการ DB
Asst.Prof. Intiraporn Mulasastra
31
ขอดของระบบฐานขอมล
ม Database Management System ชวยจดการขอมล ขอมลอยรวมกนในฐานขอมล ลดการจดเกบขอมลซ าซอน โปรแกรม และ ฐานขอมล เปนอสระตอกน น าเสนอขอมลไดงายขน เกดการใชขอมลรวมกนมากขน ความปลอดภยของขอมล
Asst.Prof. Intiraporn Mulasastra
32
Database Management System (DBMS)
Collection of components that support
•data acquisition,
•dissemination,
•storage,
•maintenance,
•retrieval,
•formatting
Asst.Prof. Intiraporn Mulasastra
33
DBMS
User Query &
Reporting
Facilities
Application
Program
Development
Facilities
Securities &
Integrity
Subsystem
Database
Access
Subsystem
Data
Dictionary
Subsystem
Data
Dictionary
Database
Users
Programmers Asst.Prof. Intiraporn Mulasastra
34
Database Management System (DBMS)
• จดการกบขอมลปรมาณมากๆไดด • ผใชหลายคนใชฐานขอมลไดพรอมกน • ก าหนดรปแบบโครงสรางขอมล • ก าหนดวธการจดการกบขอมล
- มภาษาคอมพวเตอรใชเขยนโปรแกรม
• มระบบจดการความปลอดภยของขอมล • ควบคมความสมบรณ และความถกตองของขอมล
(Data Model)
Asst.Prof. Intiraporn Mulasastra
35
Database Management System
(DBMS)
Enterprise DBMSs
Desktop DBMSs
Embedded DBMSs
Major part of information technology infrastructure
Asst.Prof. Intiraporn Mulasastra
36
DBMS Marketplace
Enterprise DBMS
Oracle: dominates in Unix; strong in Windows
SQL Server: strong in Windows
Informix: significant Unix marketshare
DB2: strong in mainframe environment
Desktop DBMS
Access: dominates
FoxPro, Paradox, Approach, FileMaker Pro
Asst.Prof. Intiraporn Mulasastra
37
Client-Server Architecture
Database
Database
a) Client, server, and
database on the
same computer
b) Mulitple clients and 1 server
on different computers
c) Multiple servers and databases on different computers
Client
Server
Client Server
Client Server Server
DatabaseDatabase
Client
Client
Client
Client
Client
Asst.Prof. Intiraporn Mulasastra
38
Organizational Roles
Indirect Parametric Power
Functional User
Technical Non Technical
DBA Analyst/Programmer Management
Information Systems
Specialization
Asst.Prof. Intiraporn Mulasastra
39
Database Specialists
Database administrator (DBA)
More technical
DBMS specific skills
Data administrator
Less technical
Planning role
Asst.Prof. Intiraporn Mulasastra
40
Summary
Databases and database technology vital to modern organizations
Database technology supports daily operations and decision making
Nonprocedural access is a crucial feature
Many opportunities to work with databases
Asst.Prof. Intiraporn Mulasastra
Textbook: Database Design, Application Development and Administration By Mannino