Database Systems: Gul Jabeen, PHD Lecturer E.Mail: Gul - Jabeen@Kiu - Edu.Pk Department of Computer Sciences
Database Systems: Gul Jabeen, PHD Lecturer E.Mail: Gul - Jabeen@Kiu - Edu.Pk Department of Computer Sciences
Database Systems: Gul Jabeen, PHD Lecturer E.Mail: Gul - Jabeen@Kiu - Edu.Pk Department of Computer Sciences
Database Systems
Lecture 5
Gul Jabeen, PhD
Lecturer
E.Mail: gul.jabeen@kiu.edu.pk
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 1
Department of Computer Sciences
Practical example 1
l We want to model a simple university database
• In our database, we have students.
• They have a name, a registration number, and a course of study.
• The university offers lectures. Each lecture may be part of some course
of study in a certain semester. Lectures may have other lectures as
prerequisites.
• They have a title, provide a specific number of credits and have an
unique ID
• Each year, some of these lectures are offered by a professor at a
certain day at a fixed time in a specific room. Students may register
for that lecture.
• Professors have a name and are member of a specific department.
BSCS-BSIT-2018-2022 Slide 2 2
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 3 3
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 4 4
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 5 5
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 6 6
Department of Computer Sciences
Second try
l Second try
• Professors use a surrogate key now
• Key is automatically generated and has no meaning beside unique identification
• Course of study is an entity type now •
BSCS-BSIT-2018-2022 Slide 7 7
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 8 8
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 9 9
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 10 10
Department of Computer Sciences
PART 2
BSCS-BSIT-2018-2022 Slide 11
Department of Computer Sciences
Practical Example 2
l Lets study another database an Examination System
of an Educational Institution
l During initial study phase, we identified following
major points
BSCS-BSIT-2018-2022 Slide 12
Department of Computer Sciences
Preliminary Study
1. Students are enrolled in programmes/degrees
2. Programmes comprise of different courses
3. Different programmes are offered at the start of semester
4. Students register courses of different programmes at the
start of every semester
5. After valid registration students attend the classes
6. Teachers submit results during and at the end of
semester
BSCS-BSIT-2018-2022 Slide 13
Department of Computer Sciences
Preliminary Study
7. Subjects’ grade points are calculated on the basis of
results submitted
8. Semester GPA is calculated on the basis of subjects’ GPs
9. Cumulative GPA is calculated on the basis of semesters’
GPAs
10. Courses, results, students data is stored in files
BSCS-BSIT-2018-2022 Slide 14
Department of Computer Sciences
Outputs Required
l Teachers and controller need
class list or attendance sheet,
class result; subject and overall
l Students need transcripts,
semester result card, subject
result
BSCS-BSIT-2018-2022 Slide 15
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 16
Department of Computer Sciences
Registration
System Student
Pe
rs
lt n
on
u t i o
s a
al
e r
R ist
De
e g
v id e
tai
o R
Pr e
ls
u rs
Co
EXAMINATION
SYSTEM
Cl
t a
sul t Su ss
e ul R
R
it es Ov bje es
er ct ul
u bm s R al R t
S las l R es
C es ult
ul
t
Teacher Controller
BSCS-BSIT-2018-2022 Slide 17
Department of Computer Sciences
MAIN MODULES
1.Subject registration
2.Result submission
3.Result calculation
BSCS-BSIT-2018-2022 Slide 18
Department of Computer Sciences Re
gis
tra
STUDENT tio
n
De PROGRAM
t ail
& COURSE
q
1.0 Va
Pre-Re
lid
Edit Form
Course
In- 2.0
Va
lid
Check
Pre-Req
ed
rifi
Ve
RESULT
REGISTRATION
es ult
s R
v iou
Pre
BSCS-BSIT-2018-2022 Slide 19
Department of Computer Sciences R
eg
istr
atio
STUDENT nD
eta PROGRAM
il
& COURSE
1.0 Va
Pre-
li d
Edit Form
Req
Course
In-V 2.0
a lid Check
Pre-Req
d
ri fie
Ve
RESULT t
esul REGISTRATION
R
vi ous
Pre
tail
Su
b jec
n De
tG
P 5.0 4.0
t GP
tratio
Update je c Calculate
S ub
Result GP
Regis
Teacher 3.0
Collect Info
lt
Result R esu
Submit Result
BSCS-BSIT-2018-2022 Slide 20
Department of Computer Sciences Re
g i s tr
atio
STUDENT nD
et a PROGRAM & COURSE
il
1.0 Va
lid
q
Course
Pre-Re
Edit Form
Controller In-Va 2.0
lid Check
Overall Result
Pre-Req
8.0
Registration Detail
Verified
Generate
sR esult
Result Previou REGISTRATION
ul t
Res
Detai ation
Subject GP 5.0
P 4.0
RESULT Update ect G
tr
j Calculate
Sub
R e g is
l
Result GP
3.0
Collect
t In fo
Result
R es ul
G
esul t PA
Su bmi t R s
7.0 6.0
Calculate Calculate
CGPA GPA
Subject GP
Teacher GPA
BSCS-BSIT-2018-2022 Slide 21
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 22 22
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 23 23
Department of Computer Sciences
Analysis Phase
BSCS-BSIT-2018-2022 Slide 24
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 25
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 26
Department of Computer Sciences
PROGRAM COURSES
STUDENT CRS_OFFERED
SEMESTER
TEACHER
BSCS-BSIT-2018-2022 Slide 27
Department of Computer Sciences
Multivalued attribute
Experience
CGPA
GPA Salary
Std _sub_detail
Grade
Student_ sub_GPA
BSCS-BSIT-2018-2022 Slide 28
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 29
Department of Computer Sciences
BSCS-BSIT-2018-2022 Slide 30
Department of Computer Sciences
Practice Session
l Application of E-R data model
l We study an example scenario and apply
the design phases we have studied so
far. Please draw a complete ER Diagram
with the given example scenario.
BSCS-BSIT-2018-2022 Slide 31
Department of Computer Sciences
THANKS
BSCS-BSIT-2018-2022 Slide 32
Department of Computer Sciences
THANKS
BSCS-BSIT-2018-2022 Slide 33