Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Flat-File Environment
User 1 Transactions
User 2 Transactions
Program 2
User 3 Transactions
X,B,Y
Program 3
L,B,M
Database Approach
User 1 Transactions
Database Program 1 D B M S A, B, C, X, Y, L, M
User 2 Transactions
Program 2
User 3 Transactions
Program 3
Because it is so different from the file-oriented approach, the database approach requires training users
may be inertia or resistance
8
Database Administrator
U S E R S
Transactions
Transactions
Physical Database
User Queries
DBMS Features
User Programs - make the presence of the DBMS transparent to the user Direct Query - allows authorized users to access data without programming Application Development - user created applications Backup and Recovery - copies database Database Usage Reporting - captures statistics on database usage (who, when, etc.) Database Access - authorizes access to sections of 10 the database
11
ANSI Model
External User Views Conceptual Model Internal Model
Physical Database
14
Query Language
The query capability permits end users and professional programmers to access data in the database without the need for conventional programs. IBMs Structured Query Language (SQL) is a fourth-generation language that has emerged as the standard query language.
15
Phase 1
Prepare the Conceptual Model
17
ER-Diagram Symbols
ER-Diagram Symbols
Entity
Relationship
Attribute
Primary Key
CUSTOMER
M places
ORDER
Order Number
Name Number
Item #
An Entity
...is an
individual object concept event
...may be a specific
tangible object intangible object
Attributes
A property of an entity that we choose to record (of interest to an organization). CUSTOMER (entity) PRODUCT (entity) customer # product # name description address finish telephone no. price balance qty. on hand
22
Cardinalities
Entity Salesperson Relationship Entity
Assigned
Car
1
Customer
Places
Order
Vendor
Supply
Inventory
E
M
A
1
Party to
Sales
M M
Sales person
Pays for
M 1
Made to
1
Customer
Cash
Increases
Cash Collections M
Received from
1
Received by
Cashier
34
Phase 2
Specify the Logical Design Create relational tables.
25
26
27
JOIN X1 Y1 Y2 Y1 Z1 Z2 Z1
X1
Y1 Y2 Y1
Y1 Y2 Y3
Z1 Z2 Z3
X2
X3
X2
X3
Properly Designed Relational Tables No repeating values - All occurrences at the intersection of a row and column are a single value. The attribute values in any column must all be of the same class. Each column in a given table must be uniquely named. Each row in the table must be unique in at least one attribute, which is the primary key.
29
When unnormalized tables are split and reduced to third normal form, they must then be linked together by foreign keys.
33
Steps in Normalization
Table with repeating groups First normal form 1NF
Remove partial dependencies Remove repeating groups
data normalization process and be able to determine whether a database is properly normalized.
35
Phase 3
Implement the Physical Design Decide about software and hardware.
36
Populate the database with data Produce physical user views (multiple)
37
Data Structures
allow records to be located, stored, and retrieved and allow movement through the database. Two components:
The organization of a file is the physical arrangement of records. The access method is the technique used to locate records and to navigate through the database.
38
Central Site
Centralized Database
Site A
Site B
Site C
42
43
Data Currency
Occurs in DDP with a centralized database During transaction processing, the data will temporarily be inconsistent as a record is being read and updated. Database lockout procedures are necessary to keep IPUs from reading inconsistent data and from writing over a transaction being written by another IPU.
44
A,B
E, F
C,D
Locked C, waiting for E
47