Database Design
Database Design
3 Database Design
User
Primary Key: user_id
Field Names Data type Data Size Description
user_id Text 10 User’s Username
user_password Text 8 User’s password
fname Text 30 User First Name
lname Text 30 User Last Name
personal_email Text 50 User Email address
dob Date 10 Date of birth
id_number Text 12 User NIC number
no Text 10 Number of the Address
street Text 100 Street of the Address
city Text 30 City of the Address
gender Text 10 User’s Gender
Record Size 300
Table 1 User
Admin
Primary Key: user_id
Field Names Data type Data Size Description
user_id Text 10 Admin’s Username
description Text 30 Type of Admin
Record Size 40
Table 2 Admin
Student
Primary Key: user_id
125
Teacher
Primary Keys: user_id, teacher_specialization
Foreign Key: user_id
Student_Course
Primary Keys: user_id, course_id
Foreign Keys: user_id, course_id
Course
Primary Key: course_id
Foreign Key: user_id
Field Names Data type Data Size Description
course_id Text 10 Course number
course_type Text 20 Course Type
course_description Text 150 Course Description
couse_name Text 50 Course Name
course_duration Number 05 Course duration
course_fee Number 15 Course fee
user_id Text 10 Teacher’s Username
Record Size 260
Table 6 Course
126
Payment
Primary key: payment_id
Field Names Data type Data Size Description
payment_id Number 5 Payment Id
payment_amount Number 10 Payment Amount
payment_description Text 30 Payment Description
Record Size 45
Table 7 Payment
Student_Course_Payment
Primary Keys: user_id, course_id, payment_id
Foreign Keys: user_id, course_id, payment_id
Field Names Data type Data Size Description
user_id Text 10 Student’s Username
course_id Text 10 Course Id
payment_id Number 5 Payment Id
payment_date Date 10 Payment Date
Record Size 35
Table 8 Student_Course_Payment
Student_Batch
Primary Keys: user_id, batch_id
Foreign Keys: user_id, batch_id
127
Batch
Primary Key: batch_id
Foreign Keys: course_id, user_id
Student_ExamSchedule
Primary Keys: user_id, exam_schedule_id
Foreign Keys: user_id, exam_schedule_id
Field Names Data type Data Size Description
user_id Text 10 Student’s Username
exam_shedule_id Text 20 Exam schedule Id
grade Text 10 Student Exam grade
Record Size 40
Table 11 Student_ExamSchedule
Exam
Primary Key: exam_id
Foreign Key: course_id
Field Names Data type Data Size Description
exam_id Text 20 Exam Id
exam_name Text 50 Exam name
exam_type Text 10 Exam Type
exam_fee Number 10 Exam Fee
course_id Text 10 Course Id
Record Size 100
Table 12 Exam
128
RepeatExamPayment
Primary Key: repeat_payment_id
Field Names Data type Data Size Description
repeat_payment_id Number 5 Repeat Payment Id
p_amount Number 10 Payment Amount
p_description Text 10 Payment Details
Record Size 25
Table 13 RepeatExamPayment
Student_ExamSchedule_RepeatExamPayment
Primary Keys: repeat_payment_id, user_id, exam_shedule_id
Foreign Keys: repeat_payment_id, user_id, exam_shedule_id
Field Names Data type Data Size Description
repeat_payment_id Number 5 Repeat Payment Id
user_id Text 10 Student’s Username
exam_shedule_id Text 20 Exam Schedule Id
p_date Date 10 Payment Date
Record Size 45
Table 14 Student_ExamSchedule_RepeatExamPayment
Exam_Schedule
Primary Key: exam_shedule_id
Foreign Keys: batch_id, exam_id
Field Names Data type Data Size Description
exam_shedule_id Text 20 Exam schedule Id
exam_name Text 30 Exam name
exam_type Text 30 Exam type
exam_start_time Time 5 Exam start date
exam_end_time Time 5 Exam end date
exam_date Date 10 Exam date
exam_status Text 20 Exam Status
batch_id Text 20 Batch Id
exam_id Text 20 Exam Id
Record Size 160
Table 15 Exam_Schedule
129
Course_Schedule
Primary Key: course_schedule_id
Foreign Key: batch_id
Student_CourseSchedule
Primary Keys: course_schedule_id, user_id
Foreign Keys: course_schedule_id, user_id
Field Names Data type Data Size Description
course_shedule_id Text 20 Course schedule Id
user_id Text 10 Student’s Username
time Time 5 Student attend time
attend_date Date 10 Student attend date
status Text 10 Student attendance status
Record Size 55
Table 17 Student_CourseSchedule
Feedback
Primary Key: feedback_id
Foreign Key: user_id
Field Names Data type Data Size Description
feedback_id Number 5 Feedback Id
feedback_rating Text 5 Feedback rating
feedback_comment Text 150 Feedback comment
feedback_date Date 10 Feedback timestamp
user_id Text 10 Student’s/ Teacher’s
Username
Record Size 180
Table 18 Feedback
130
Message
Primary Key: message_id
Foreign Key: user_id
CourseWork
Primary Key: coursework_id
Foreign Keys: batch_id, user_id
Field Names Data type Data Size Description
coursework_id Number 5 Coursework Id
coursework_content Text 200 Coursework content
coursework_file Text 50 Coursework file
date Date 10 Coursework date
deadline Date 10 Coursework deadline
batch_id Text 20 Batch Id
user_id Text 10 Teacher’s Username
Record Size 305
Table 20 CourseWork
Student_CourseWork
Primary Keys: user_id, coursework_id
Foreign Keys: user_id, coursework_id
ExamSchedule Location
Primary Keys: exam_shedule_id, exam_location
Foreign Key: exam_shedule_id
Field Names Data type Data Size Description
exam_shedule_id Text 10 Exam schedule Id
exam_location Text 20 Exam Location
Record Size 30
Table 24 ExamSchedule Location
132