UML Logical Modelling Exercises - Solutions
UML Logical Modelling Exercises - Solutions
Answer: No, ProductName is an attribute of Product, therefore, being in the same table as the order
information causes addition, delete and update problems.
To be normalized, ProductName should be deleted from this relation, making ProductID a foreign Key to a new
relation, which should contain ProductID and ProductName.
The table should only contain OrderID and Customer ID, and Product ID.
Question 2. Which relation/s could correctly belong to the relational model of the following conceptual
model:
Feedback: In the relation SuperMarket(ID, Address, AisleID), AisleID would be a list according to the maximum
cardinality Supermarket->Aisle, which is not allowed. In addition, the AisleInSupermarket(SupermarketID,
AisleID) relation would allow an Aisle to be part of many Supermarkets.
Since an Aisle can only belong to one supermarket, the assotiation should be represented as a foreign key
within the Aisle relation.
Question 3. Which relation could correctly belong to the relational model of the following conceptual
model:
Feedback: In the relation Aisle(ID, Location, AisleIDNextTo), AisleIDNextTo would be a list (according to the
cardinality 0..*), which is not allowed.
Question 4. Which of the following relations could correspond to the following class diagram?
A. DEPARTMENT
B. EMPLOYEE
C. DEPARTMENT
Feedback
B. Feedback: an employee can work in more than one department, therefore, DepartmentNumber cannot be a
column as its value could be a list.
C. Feedback: Primary key cannot be NULL.
D. Feedback: Belonging to a department is mandatory (minimum cardinality at the side of Department is 1),
and according to this table James English does not belong to a department.
Question 5. Which of the following relations could correspond to the following class diagram? Explain
your answer.
A. Aisle B. SuperMarket
C. SupermarketInRetail D. RetailCompany
Feedback
A: Having SupermarketID as part of the primary key allows an aisle to be part of many supermarkets (e.g., aisle
15 belongs to 2 different supermarkets). To be correct, SupermarketID shoudn’t be part of the primary key,
and aisle 15 should belong only to 1 supermarket.
B: A supermarket must belong to a retail company, and therefore the attribute cannot be NULL.
C. Since a supermarket belongs to only one retail company, the association with RetailCompany must be
represented as a foreign key within the Supermarket relation, otherwise a supermarket could belong to more
than one retail company.
Question 6. Create a normalised relational model (i.e., indicate the relations) for the following
conceptual model:
Answer:
OWNER (Passport, Name, Email)
PET(ID, AnimalType, OwnerPassport)
Question 7. Create a normalised relational model for the following conceptual model:
Possible answer:
SHOP (ID, address,)
CUSTOMER (Passport, address, email, ....)
SHOPPING (CustomerPassport, ShopID)