Database Application SAK 3408
Database Application SAK 3408
Database Application
SAK 3408
CHAPTER 2
DATABASE DESIGN
Introduction
Program
SQL
Design
Best:
Spend your time
on design and SQL.
User views
of data.
Conceptual
data model.
Implementation
(relational)
data model.
Class diagram
that shows
business
entities,
relationships,
and rules.
Physical
data
storage.
Indexes and
storage methods
to improve
performance.
Design Stages
5
Initiation
Physical Design
Scope
Feasibility
Cost & Time estimates
User feedback
Queries
Forms
Reports
Application integration
Data storage
Security
Procedures
Implementation
Models
Forms
Reports
Conceptual Design
Table definitions
Application development
Requirements Analysis
Training
Purchases
Data conversion
Installation
Variations on ER Attribute
Display
Attributes in Ellipse
PATIENT
PAT_birthdate
PAT_idnumber
PAT_homephone
PAT_firstname
PAT_zipcode
PAT_lastname
PAT_state
PAT_address
PAT_city
Variations on ER Attribute
Display
PATIENT
PAT_birthdate
PAT_idnumber
PAT_homephone
PAT_firstname
PATIENT
PAT_zipcode
PAT_lastname
PAT_state
PAT_address
PAT_city
PAT_idnumber
PAT_firstname
PAT_lastname
PAT_address
PAT_city
PAT_state
PAT_zipcode
PAT_homephone
PAT_birthdate
Attributes in Rectangle
Patient
PAT_idnumber
PAT_firstname
PAT_lastname
PAT_address
PAT_city
PAT_state
PAT_zipcode
PAT_homephone
PAT_birthdate
Patient
PAT_idnumber
PATIENT
Entity with No Attributes
Entity
person,
Attribute
property
Relationship
association
Entity Type
12
Example
Person
Place
Object
Event
REGISTRATION, APPLICATION
Concept
COURSE, ACCOUNT
ER VARIATIONS - CHEN
MODEL
EntityName
Verb Phrase
AttributeName
Example:
profID
profName
PROFESOR
teaches
CLASS
className
classID
Entity
Relationship
<identfier>
name>
<attribute-1>
Verb phrase
<attribute-2>
<attribute-3>
Attribute
Example:
PROFESSOR
profID
profName
CLASS
teaches
classID
className
entity
attribute
identifier
relationship
A special entity
that is also a
relationship
Entity
symbols
Relationship
symbols
Attribute
symbols
Entity
18
Rows represented
entity instances of
the entity type
75115
75794
76740
77388
77512
77558
77655
78436
78447
84781
84817
84858
84904
85013
85042
Farazila Yusof
Wan Haniza Wan Hassim
Norwani Mohd Zain
Zarawahida Zakaria
Rozita Bt Bahamad
Armamorhana Ahmad
Siti Amrah Zakaria
Siti Nor Haiza Mad Janapi
Noriati Jaminah
Emilza Fuad
Azli Kamarudzaman
Faddly Mazlan
Balkhis Diba Mansor
Aina Najmi Shari
Ku Irdawaty Ku Yaakob
Should be concise.
Attribute
21
Identifier Attributes
22
An Example of Composite
Attribute
An attribute
broken into
component parts
Derived
from date employed and current date
Multivalued:
an employee can have
more than one skill
Identifier (Key)
24
Characteristic of Identifier
25
Relationship
Relationship name:
writes
Author
Book
Relationship
29
Relationship type
30
Degree of Relationship
31
Relationship
Binary Relationship
Ternary Relationship
One entity
related to
another of
the same
entity type
Entities of
two different
types related
to each other
Entities of three
different types
related to each
other
Cardinality of Relationship
33
One to One
One to Many
Many to Many
STUDENT
registers
COURSE
LECTURER
Binary relationships
37
STUDENT
registers
COURSE
teaches
has
LECTURER
Cardinality Constraints
39
Maximum Cardinality
The
maximum number
Cardinality Constraints
41
Strong entities
exist independently of other types of entities
has its own unique identifier
represented with single-line rectangle
Weak entity
dependent on a strong entitycannot exist on its own
Does not have a unique identifier
represented with double-line rectangle
Identifying relationship
links strong entities to weak entities
represented with double line diamond
Strong entity
Identifying relationship
Weak entity
Associative Entity
45
AND its a
46
48
A small company that rents canoes needs a database to track basic information
about the rental and the canoes. Eventually, the firm wants to identify customers who
cause problems by damaging the canoes, but for now, the managers just want to
track the costs. The managers have outlined the data as a form. Draw an ER
diagram for this case.