Database Modeling-I
Database Modeling-I
1
5. Data independence (a relative term) -- avoids reprogramming of applications,
allows easier conversion and reorganization
* physical data independence—program unaffected by changes in the storage structure
or access methods
*Y2K (year 2000) problem—many systems store 2-digit years (e.g. ‘02-OCT-98’) in
their programs and databases, that give incorrect results when used in date arithmetic
(especially subtraction), so that ‘00’ is still interpreted as 1900 rather than 2000. Fixing
this problem requires many hours of reprogramming and database alterations for many
companies and government agencies.
2
3
4
5
Characteristics of a Good Database Design Process
* iterative requirements analysis
- interview top-down
- use simple models for data flow and data relationships
- verify model
6
II. Requirements Analysis
7
Data and Process Dictionary Entries for Requirements Analysis
in the Database Design Lifecycle
Entity Description (possibly in a data dictionary)
Name customer
Reference-no 4201
Cardinality 10,000
Growth rate 100 per month
Synonyms user, buyer
Role (or description) someone who purchases or rents
a product made by the company.
Security level 0 (customer list is public)
Subtypes adults, minors
Key attribute(s) cust-no
Non-key attribute(s) cust-name, addr, phone, payment-status Relationship to
other entities salesperson, order, product
Used in which applications billing, advertising
Attribute description (data elements in a data dictionary)
Name cust-no
Reference-no 4202
Range of legal values 1 to 999,999
Synonyms cno, customer-number
Data type integer
Description customer id number set by the company.
Key or nonkey key
Source of data table of allowable id numbers
Used in applications billing
Attribute trigger /*describes actions that occur when
a data element is queried or
updated*/
Relationship description
Name purchase
Reference-no 511037
Degree binary
Entities and connectivity customer(0,n), product(1,n)
Synonyms buy
Attributes (of the relationship) quantity, order-no
Assertions a customer must have purchased at
least one product, but some products
may not have been purchased as yet
by any customers.
Process (application) description
Name payroll
Reference-no 163
Frequency bi-weekly
Priority 10
Deadline noon Fridays
Data elements used emp-name, emp-salary
Entities used employee
Data volume (how many entities) implicit from entity cardinality
8
Interviews at different levels
Top management - business definition, plan/objectives, future plans
Middle management - functions in operational areas, technical areas, job-titles, job functions
Employees - individual tasks, data needed, data out
Specific end-users of a DBMS - applications and data of interest
2. Agree with the interviewee on format for documentation (ERD, DFD, etc.)
3. Define human tasks and known computer applications
9
III. Entity-Relationship (ER) Modeling
Entity - a class of real world objects having common characteristics and properties about
which we wish to record information.
* degree - number of entities associated in the relationship (binary, ternary, other n-ary)
* Surrogate - system created and controlled unique key (e.g. Oracle’s “create sequence”)
10
11
12
13
Super-class (super-type)/subclass (subtype) relationship
Generalization
* similarities are generalized to a super-class entity, differences are specialized to a subclass
e called an “ISA” relationship (“specialization” is the inverse relationship)
Aggregation
* “part-of” relationship among entities to a higher type aggregate entity (“contains” is the
inve relationship)
14