INFO 2312 Assignment 1 Summer 2021
INFO 2312 Assignment 1 Summer 2021
INFO 2312
Assignment 1
Note for submission: Please submit a pdf containing the solutions of problem 1, problem 2 and
problem 3. No other type of submission is allowed. For problem 1, you can take a screenshot or
scanned image of your handwritten diagram. For problem 2 and problem 3, typed answers are
needed in the space provided after questions. Only one submission per student is allowed.
1. A company database needs to store information about employees (identified by SIN, with
salary and phone as attributes), departments (identified by DID, with dname and budget as
attributes), and children of employees (with name and age as attributes). Employees work in
departments; each department is managed by an employee; a child must be identified
uniquely by name when the parent (who is an employee; assume that only one parent works
for the company) is known. We are not interested in information about a child once the
parent leaves the company.
Draw an ER diagram using Crows Foot notation that captures this information. [10 Marks]
Employee
Department Is managed by
DID Sin
dname Salary
budget Phone no
Is parent
Child of employee
Name
Age
Solution: -
1.one or more Employee can worked in Department(strong entity) and at least one
department is managed by an employee.
So department and employee has 1:M relationship
2. Child of employee is weak entity that is not exist without Employee entity
3. Child of employee is weak entity with id dependent because it has partial key Name. it
need two identify attributes- sin(primary key) attribute of Employee entity and name
(partial key ) attribute as second identifier to uniquely identify record of child of employee
entity.
2.
Consider the ER diagram of online sales system above. Based on the diagram answer the
questions below,
a) Based on the ER Diagram, determine the Foreign Key in the Product Table. Just mention
the name of the attribute that could be the Foreign Key. [2 Marks]
OrderID
b) Mention the relationship between the Order and Customer Entities. You can use the
following: [4 Marks]
Many orders can be placed by one costumer but at least one order should be placed
by a customer
M:1
c) Is there a direct relationship that exists between Store and Customer entities? Answer
Yes/No? [1 Marks]
No
d) Which one of the 4 Entities mention in the diagram can have a recursive relationship?
[1 Marks]
Order
Create a database with multiple tables from attributes as shown above that are in 3NF,
showing PK, non-key attributes, and FK for each table? Assume the tables are already in
1NF. [Hint: 3 tables will result after deducing 1NF -> 2NF -> 3NF] [5 Marks]
Show the steps here.
1.Firstly, Check there is no multivalued attribute and no retepting groups but there is
partial dependency like
C1->C2, C3, C4, C5
C4->C5
So this is in 1NF form but not in 2NF and 3NF
C1->C2
C1 C2
C1->C3, C4,C5
C1 C3 C4 C5
Step 3: 2NF->3NF
Still there is transparent dependency like C1->C3, C4,C5, there is key attribute C1
identified non key attribute C4 then C4 non key identified non key attribute C5.
C1->C2
C1 C2
C1->C3,C4
C1 C3 C4
C4->C5
C4 C5
Now these are in 3NF