Beruflich Dokumente
Kultur Dokumente
Problem analysis
Entity Relationship notation
Integrity constraints
Generalization
Introduction: Lifecycle
Requirement analysis
-> Text
Name
Name
VName
DID
VName
SID
Conceptual Design
-> ER-Model
Studentin
Dozentin
(1,*)
(1,*)
anmelden
Name
(0,*)
KID
(1,1)
Kurs
Dauer
Vorgnger
(0,*)
halten
(0,*)
Nachfolger
voraussetzen
Administration
1.2
Database
Requirements
Conceptual modeling
Logical modeling
Physical modeling
Software Engineering
Requirements
Analysis
Design
1.3
Requirement Analysis
Customer communication!
Identify essential "real world" information
Remove redundant, unimportant details
Clarify unclear natural language statements
Fill remaining gaps in discussions
Distinguish data and operations
1.4
.... Not all of our movies have star actors. Customers like to know
each actors real birth name and age. We track only actors who
appear in the movies in our inventory.
We have lots of customers. We only rent videos to people who have
joined our video club. To belong to our club, they must have
good credit. For each club member, wed like to keep their first and
last name, current phone number, and current address. And, of
course each club member has a membership number.
Then we need to keep track of what video tapes each customer
currently has checked out. A customer may check out multiple
video tapes at any given time. Rentals are for one or more days,
each movie with an individual price per day. Furthermore we
additionally charge 1 $ per beta format tape, 2 $ for a DVD and
another $ for movies longer than 2 hours. Maximum rental time is 4
weeks. The customer gets a bill with movie titles, individual prices
and total amount, when he /she returns movies."
1.6
1.7
Fill gaps
Any discounts?
...
Distinguish data/operations
FU-Berlin, DBS I 2006, Hinze / Scholz
Processing a bill
Becoming a member of the club
1.8
Entity
something which exists
Examples: tape, movie
Attribute
Tape
Movie
property of an entity
Examples: tape has id, movie has title
Relationship:
connects two or more entities
Examples: tape contains a movie.
Tape
id
Tape
Movie
contain
id
title
Movie
title
1.9
Name
Student
SID
attend
Title
LID
FName
Lecture
hours
FU-Berlin, DBS I 2006, Hinze / Scholz
attend
Lecture
LID:
Number
Title: String
hours: Number
1.10
attribute
attribute
Movie
Tape
FU-Berlin, DBS I 2006, Hinze / Scholz
id
title
director
category
attribute
Entity_1
relationship
Entity_2
attribute
attribute
Customer
rents
Tape
1.12
id
(without customers)
category
year
director
id
Tape
Movie
hold
Price_per_day
belong_to
play
Format
Actor
name
charge
length
birthday
stage_name
real_name
1.14
Student
hold
Recursive relationships
Lecture
FU-Berlin, DBS I 2006, Hinze / Scholz
predecessor
Person
successor
require
parent
child
have
role name
1.15
Lecturer
hold
rating
Lecture
hold
belong_to
Lecture_date
Lecturer
rating
1.16
1.17
Attribute restrictions
Cardinality restrictions
Attribute restrictions
Attribute contain at most one value:
unstructured attribute restriction of E-R M.
Key attributes are unique
Movie
drivers license
Tape
own
Person
hold
Movie
play
Actor
1.19
Tape
k1
E1
rent
k2
R
1
E2
Customer
Min-Max Notation:
(min1,max1)
E1
E2
R
(min2,max2)
Tape
(0,1)
rent
(0,*)
Customer
(0,1)
have
(1,1)
driversLicence
1:N relationship
Movie
Lecture
N:M relationship
FU-Berlin, DBS I 2006, Hinze / Scholz
User_account
(1,*)
(1,1)
(0,*)
hold
hold
has
Tape
(1,1)
Lecturer
(0,*)
emailMessage
(1,*)
Important concept
(without customers)
title
id
(1,1)
Tape
hold
(1,*)
(1,1)
director
id
Movie
(0,*)
belong_to
play
Price_per_day
length
(1,*)
(0,*)
Actor
Format
name
year
category
charge
birthday
stage_name
real_name
1.23
mandatory/
multiple
optional/
multiple
optional/
single
mandatory/
single
E-RM
(min,max)
(1,*)
(0,*)
(0,1)
(1,1)
E-RM
1:N
N or M
N or M
UML
1 ..*
k..j
k
0 ..*
*
0 .. k
0 .. 1
(1,*)
has
(1,1)
Room
Notation:
E1
(min1,max1)
(min2, max2)
id
E2
id
(0,*)
has
(1,1)
Scene
Oid
(1,*)
has
(1,1)
Item
Iid
(1,1)
FU-Berlin, DBS I 2006, Hinze / Scholz
contains
(1,*)
Delivery
Did
1.26
employee
(0,*)
(1,1)
has
cid
child
eid
or
cid
eid
employee
(0,*)
has
(1,1)
child
customer
rent
(0,*)
from
(0,1)
vid
videotape
until
customer
(0,*)
videotape
videotape
(0,*)
is_in
(1,1)
(0,*)
cid
customer
(0,*)
has
(1,1)
rental
vid
until
from
1.28
title
category
year
Format
(0,*)
belong_to
hold
(1,1)
Tape
(1,*)
Movie
(0,*)
Address
until
have
(1,*)
Last_name
Actor
Mem_no
Rental
(1,1)
play
Telephone
(1,1)
from
length
First_name
(0,*)
is_in
id
Price_per_day
(1,1)
id
director
stage_name
(0,*)
Customer
birthday
real_name
1.29
(0,*)
recommend
(1,*)
Textbook
(1,*)
Lecture
Cardinalities:
FU-Berlin, DBS I 2006, Hinze / Scholz
E2
recommend
N Textbook
Lecture
FU-Berlin, DBS I 2006, Hinze / Scholz
1.31
attend
Topic
Student
1.32
Textbook
Lecture
Lectureplan
Lecture
Textbook
1.33
Lecturer
FName
hold1
Name
lid
Student
attend
Lecture
FName
FU-Berlin, DBS I 2006, Hinze / Scholz
hold2
Name
SID
hours
LID
title
Lecture
title
hold
LID
attend
FName
Person
Name
Email
is-a
is-a
Student
Lecturer
pid
Contract
SID
A
is-a
is-a
DB interpretation:
Instances of B and C also instances of A: B A and C A
Key-inheritance
"is-a" different from ordinary relationships
Special cases:
Disjoint specialization: Instances of B and C are disjoint
Complete specialization: A = B C, no extra tupel in A
1.36
Important terms