Professional Documents
Culture Documents
Primary keys: - the attributes of each entity that are underlined attributes.
Foreign keys: - the attributes that are both bolded and italicized.
Composite Attributes: -
o PharAdress [Pharmacy],
o EmpAddress [Employee],
o CustAddress [Customer] and
o SupAdress[Supplier]
Multivalued attributes:
o EmpMobilePhone( EmpMobilePhone1, EmpMobilePhone2,…)
o SupPhone (SupPhone2, SupPhone1, …) and
o CustMobilePhone (CustMobilePhone1, CustMobilePhone2,…)
Derived Attribute:
EmpAge [derived from EmpDoB]
Cardinality
1. A single pharmacy can have multiple employees. Thus, the relation between
them is one to many.
2. A single employee can handle multiple customers. Thus, the relation between
them is one to many.
3. A single customer can hold multiple prescriptions. Thus, the relation between
them is one to many.
4. A single prescription can only make a single payment. Thus, the relation between
them is one to one.
5. A single payment can order multiple products, but a single product can only be
ordered by a single payment. Thus, the relation between them is one to many.
6. multiple products can be supplied by a single Supplier. Thus, the relation
between them is many to one.
7. One supplier can be contacted by multiple pharmacy branches and one
pharmacy branch can contact multiple suppliers. Thus, the relation between
them is many to many.
Normalization 3NF
Avoid multivalued attributes: - EmpMobilePhone, SupPhone, CustMobilePhone but instead
add attributes on Employee (EmpMobilePhone1 and EmpMobilePhone2), on Supplier
(SupPhone1, SupPhone2) and on Customer (CustMobilePhone 1, CustMobilePhone2)
Avoid composite attributes: - PharAdress, EmpAddress, CustAddress, SupAdress.
Avoid derived attributes: - EmpAge [derived from EmpDoB].
Avoiding transitive dependency
1. Normalization Table for Pharmacy: -