Werabe University: Fundamentals of Database System Assignment II
Werabe University: Fundamentals of Database System Assignment II
WERABE UNIVERSITY
DEPARTMENT OF MATHEMATICS
Assignment II
Submission Date:
ID:
1
Assignment II
1.
COURSE
STUDENT
Course_Code Course_Title ECTS
Stud_ID Stud_Name Sex
Comp203 Introduction To Computer 5
021/02 Abdu Yasin M
Mgt2020 Entrepreneurship 5
001/02 Abiy Girma M
ICT022 Visual Basic 6
029/02 Terhas Girma F
ICT233 Java Programming 6
GRADE
Stud_ID Course_Code Grade
021/02 Comp203 A
021/02 Mgt2020 B
001/02 ICT233 A
001/02 Mgt2020 A
029/02 ICT022 C
029/02 Comp203 B
2.
i) Primary key for each entity is as follows
Primary key for Student is Stud_ID
Primary key for Course is Course_Code
Primary key for Grade is a combination of Stud_ID and Course_Code
ii) The foreign key for each entity is as follows
Foreign key for Grade is Stud_ID and Course_Code
Foreign key for Student is given as or student enrolled to take a course is given by the
following table so the above Student table can be drawn as follows.
STUDENT
Stud_ID Stud_Name Sex Course_Code
021/02 Abdu Yasin M Comp203
021/02 Abdu Yasin M Mgt2020
001/02 Abiy Girma M ICT233
001/02 Abiy Girma M Mgt2020
029/02 Terhas Girma F ICT022
029/02 Terhas Girma F Comp203
Therefore, at this time the foreign key for Student table is Course_Code.
2
iii) Among the three tables, Grade table is Associative entity and it does not has a primary
key instead, it contains a number of foreign keys from the junction table to the
individual data tables. The PK of the associative table is typically composed of
the FK columns themselves. Therefore, the foreign key for Grade table is Stud_ID and
Course_Code.
iv)
V. As indicated by the above ER diagram the cardinality of the above three entities are described
in the following table.
Entities Participated Name of a Cardinality of each
relationship relationship
Student to Course Enrolls One to Many(1:M)
Course to Grade has One to One(1:1)
Student to Grade has One to Many(1:M)