Beruflich Dokumente
Kultur Dokumente
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
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)