DBMS-independent
LOGICAL DESIGN
(DATA MODEL MAPPING)
DBMS-specific
APPLICATION PROGRAM
DESIGN
PHYSICAL DESIGN
Application Programs
Example Database Application (Company Database)
Companys EMPLOYEEs name, ssno, address, salary, sex and birth date are
recorded. An employee is assigned to one department, but may work for
several projects (not necessarily controlled by her dept). Number of
hours/week an employee works on each project is recorded; The immediate
supervisor for the employee.
N
Hours
supervisor supervisee N
WORKS_ON PROJECT
1 SUPERVISION N 1
Name
Location
Number
______
DEPENDENTS_OF
DEPENDENT
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Entities and Attributes
Figure 3.3
Attribute types:
Simple vs Composite (Figure 3.4)
Single-valued vs Multi-valued (e.g. Locations for DEPARTMENT)
Stored vs Derived (e.g. NumberOfEmployees for DEPARTMENT)
Age = 55
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 3.4 A hierarchy of composite attributes; the
StreetAddress component of an Address is further composed
of Number, Street, and ApartmentNumber.
Address
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 3.5 A complex attribute AddressPhone with
multivalued and composite components.
{AddressPhone( {Phone(AreaCode,PhoneNumber)},
Address(StreetAddress(Number,Street,ApartmentNumber),
City,State,Zip) ) }
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Entity Types, Value Sets, Key Attributes
An entity type defines a set of entities that have the same attributes.
See Figure 3.6
e1 c1
e2 c2
ENTITY SET: (Fred Brown, 40, 30K) (Fast Computer, Dallas, Bob King)
(EXTENSION)
e3
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 3.7 The CAR entity type, with two key attributes Registration and
VehicleID. Multivalued attributes are shown between set braces {}.
Components of a composite attribute are shown between parentheses ().
CAR
Registration(RegistrationNumber, State), VehicleID, Make, Model, Year, {Color}
car1
((ABC 123, TEXAS), TK629, Ford Mustang, convertible, 1998, {red, black})
car2
((ABC 123, NEW YORK), WP9872, Nissan Maxima, 4-door, 1999, {blue})
car3
((VSY 720, TEXAS), TD729, Chrysler LeBaron, 4-door, 1995, {white, blue})
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Initial design of the COMPANY DATABASE
Figure 3.8
4 entity types:
DEPARTMENT
EMPLOYEE
PROJECT
DEPENDENT
DEPARTMENT
Name, Number, {Locations}, Manager, ManagerStartDate
PROJECT
Name, Number, Location, ControllingDepartment
EMPLOYEE
Name (FName, MInit, LName), SSN, Sex, Address, Salary,
BirthDate, Department, Supervisor, {WorksOn (Project, Hours)}
DEPENDENT
Employee, DependentName, Sex, BirthDate, Relationship
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Relationships, Roles, Structural Constraints
r1
e1
r2 d1
e2
e3 d2
r3
e4 d3
r4
e5
r5
e6
e7 r6
r7
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 3.10 Some relationship instances
of a ternary relationship SUPPLY.
SUPPLIER SUPPLY
PROJECT
s1 r1
s2 j1
r2
j2
r3
j3
r4
PART
r5
p1
p2 r6
p3
r7
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Role names
r1
e1 2
1
r2
e2 2
e3 1
r3
2
e4
1
2 r4
e5
1
e6 1
2 r5
e7
2
r6
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Structural Constraints on Relationships
2 types:
Participation Constraint
* partial participation
In ER Diagrams:
total participation is denoted by double line and
partial participation by single line
cardinality ratios are mentioned as labels of edges
Figure 3.12 The 1:1 relationship MANAGES, with partial
participation of employee and total participation of DEPARTMENT.
EMPLOYEE
MANAGES DEPARTMENT
e1
r1
d1
e2
r2
e3 d2
e4
r3 d3
e5
e6
e7
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Figure 3.13 The M:N relationship WORKS_ON
between EMPLOYEE and PROJECT.
WORKS_ON
EMPLOYEE
r1 PROJECT
e1
r2
e2 p1
e3 r3
p2
e4
r4
p3
r5
p4
r6
r7
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Attributes of relationships:
Such entities are identified by being related to other entity sets called
identifying owner.
This relationship is called identifying relationship.
ENTITY TYPE
Figure 3.14
RELATIONSHIP TYPE
KEY ATTRIBUTE
MULTIVALUED ATTRIBUTE
...
COMPOSITE ATTRIBUTE
DERIVED ATTRIBUTE
E1 R E2 TOTAL PARTICIPATION OF E2 IN R
1 N
E1 R E2 CARDINALITY RATIO 1: N FOR E1:E2 IN R
(0,N) (0,1)
worker
SUPERVISION (0,N)
WORKS_ON
(1,N)
employee controlled-
project
project (1,1)
PROJECT
Name
DEPENDENTS_OF
Number Location
dependent
(1,1)
DEPENDENT
Relationship
Name Sex BirthDate
Addison Wesley Longman, Inc. 2000, Elmasri/Navathe, Fundamentals of Database Systems, Third Edition
Some of the Currently Available
Automated Database Design Tools
COMPANY TOOL FUNCTIONALITY
Embarcadero ER Studio Database Modeling in ER and IDEF1X
Technologies
DB Artisan Database administration, space and security
management
Oracle Developer 2000/Designer 2000 Database modeling, application development
Popkin System Architect 2001 Data modeling, object modeling, process modeling,
Software structured analysis/design
Platinum Enterprise Modeling Suite: Data, process, and business component modeling
(Computer Erwin, BPWin, Paradigm Plus
Associates)
Persistence Pwertier Mapping from O-O to relational model
Inc.
Rational (IBM) Rational Rose UML Modeling & application generation in C++/JAVA
Resolution Ltd. Xcase Conceptual modeling up to code maintenance
Sybase Enterprise Application Suite Data modeling, business logic modeling
Visio Visio Enterprise Data modeling, design/reengineering Visual Basic/C++