Sie sind auf Seite 1von 5

Premises

The case study states that All donors and recipients will be people. This indicates
that there will be a superclass/ subclass relationship between 3 entities, with the
parent being and entity called People and the children called donors and
recipient.
Attributes are given by the case study as follows. Hatblot Number, Name;
comprising family name and title, i.e. a multi-valued attribute, address and
preferred telephone number. Since the case study state that each person known
to Hatblots is given Blood Tests it stands to reason that attributes associated will
blood tests will be applicable to the entity People
A person given a transfusion is a recipient and thus a patient, however, there exists
other patients who have not gotten a transfusion. Thus patient is not a new entity
since it is subsumed under recipient in this context.
Packs act as a necessary go between donor and recipient. Thus a donor cannot give
blood unless it is in the form of a pack the same applies to the recipient as well.
There is a relationship between pack and recipient called transfusion, which is
defined by a particular pack or number of packs being given to a recipient on a
given date.
Since only donated packs can be tested, when a pack with a given serial number,
donor date and donor number with a null value

Assumptions
A donor cant also be a recipient
A donor can donate multiple times
Only one donor can contribute blood to any given pack
Many recipients can receive donations from any given pack
A recipient may receive more than 1 pack on a given date.
All donations are given a serial number, dated and linked to a donor number prior to
testing
All donations must be tested
Tested donations with a negative result will never be given to a recipient

People (hatblotno, name, familyname, title, address, telno, ABO, rhesus)


Primary Key (hatblotno)
Constraint title in (mrs, mr miss, ms, dr)
Constraint ABO in (A, B, O)
Constraint Rhesus in (positive, negative)
Rationale
Since the case study stated that each person has to have above listed attributes
and the values for both the ABO and Rhesus statuses were given, these were given
constraints as per the case study.
Donor (donorhatblotno, donatedate)
Primary Key (donorhatblotno)
Recipient (recipienthatblotno, recipdate)
Primary Key (recipienthatblotno)
Rationale
There is a superclass / subclass relationship between the People relation and the
Donor and Recipient relation (above). This means that the child must inherit the key
of the parent. Additionally, since a donor cannot be a recipient, there is no need to
differentiate donor and recipient numbers since they are assumed to never overlap.
Thus each will only appear in one table.
Pack (serialNo, donordate, donorhatblotno*, recipdate, recipienthatblotno*,
testresult)
Primary Key (serialno)
Constraint testresult in (good, bad)
Rationale
The case study states explicitly that each pack must have a serial number, donation
date and a on which the pack was given i.e received by the recipient transfused,
where the recipient is uniquely identified by the hatblot number that is inherited
from the parent relation People
Each pack is said, within the case study, to undergo a test to determine whether or
not the donation can be used. This status is recorded as a constrained attribute.

Normalization
UNF
date
session
pack_number
location_name
location_address
attendant_in_charge
technician
nurse
1NF
pack_number
session
location_name
location_address
attendant_in_charge
technician
nurse
location

2NF
pack_number
session
location_name
location_address
attendant_in_charge
technician
nurse
location
date
3NF
(location_name, location_address)
(date, attendant_in_charge, location_name*)
(session, technician, nurse, date*)

Named Relations
Location (location_name, location_address)
Attendant Schedule (date, attendant_in_charge, location_name*)
Session Staff Schedule (session, technician, nurse, date*)
Pack Usage Log (pack_number, session*, location_name*, date*)

A
Select *
From donor, person
Where person.hatblotno=donor.donorhatblotno and ABO = A and Rhesus =
Negative
B
Select hatblotNo, name, ABO, Rhesus
From person, recipient
Where person.hatblotNo=recipient.reciphatblotNo
C
Select name
From person, pack
Where person.hatblotNo=pack.donorhatblotNo and serialNo = 20130241
D
Select name
From person
Where hatblotNo = (Select donorhatblotNo
From Pack
Where serialNo = 20130241)

Das könnte Ihnen auch gefallen