0% found this document useful (0 votes)
18 views16 pages

Project Report GR 9

Uploaded by

Lê Huy Dũng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views16 pages

Project Report GR 9

Uploaded by

Lê Huy Dũng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

SCHOOL OF INFORMATION AND COMMUNICATIONS


TECHNOLOGY

FINAL PROJECT REPORT


DATABASE LAB
SEMESTER 2024.1

Topic: School Management System


Group: 9
Class: IT3290E
Class ID: 151998

1. Description Hanoi 12/2024


I - Business Context

The School Management System database is designed to streamline academic and administrative
processes within educational institutions such as schools, colleges, or universities. This comprehensive
system supports key functionalities, including student enrollment, attendance tracking, grade
management, and class scheduling. Tailored for various stakeholders—students, teachers, parents, and
administrators—the database ensures policy compliance, maintains data integrity, and provides
actionable insights to optimize institutional operations and enhance the overall academic experience.

II - Users (Roles and Responsibilities)

The School Management System database supports the following user roles, each with specific
responsibilities:

Students

● Roles:

o Primary users of the system for academic and attendance tracking purposes.

● Responsibilities:

o Provide accurate personal and enrollment details during registration.

o Regularly monitor grades, attendance, and class schedules in the system.

o Ensure compliance with attendance policies (minimum 75%) and submit valid excused
absence requests on time.

o Enroll in subjects and classes within the designated timeframes and confirm course
schedules.

Teachers

● Roles:

o Key contributors to academic data management.

● Responsibilities:

o Input and update grading information, including assignments, exams, and attendance
scores.

o Set up and log attendance for every class session.

o Review and approve excused absence requests with appropriate documentation.

o Ensure grade submissions within the specified deadlines.

o Provide and verify availability for class scheduling purposes.


Parents

● Roles:

o Limited access to monitor student performance.

● Responsibilities:

o Review grades and attendance records of their wards.

Administrators

● Roles:
○ System operators and policy enforcers.

● Responsibilities:

○ Manage system data, including maintaining accurate records of students, teachers, and
parents.

○ Oversee scheduling, enrollment validation, and attendance policy enforcement.

○ Generate reports for administrative purposes, such as identifying low-performing


students or high-demand courses.

○ Ensure smooth operation and compliance with institutional policies.

III - Business Processes

GRADING SYSTEM:

Business process: A grading system involves setting up processes to evaluate, score, and classify student
performance based on assignments, exams, and attendance. Teachers will update the grading scale,
deciding on letter grades (A, B, C, etc.). Next, weights are assigned to each component of the course
depending on their importance. Then, collect and normalize scores to ensure uniformity—this may
involve adjusting scores to a common scale if components have different maximum points. To calculate
the total grade, multiply each component’s score by its weight, summing these weighted scores to
produce a final result ( in our database the weight of attendance score, assignment score and exam
score weights are 0.1, 0.2, 0.7 respectively ). This final grade can then be converted into the appropriate
letter grade . Each student has their ID, therefore they can verify the process result and announce it to
the teacher for appropriate modification. Before the exam occurs, teachers need to check the students
who have their attendance score under 7.5, these students will immediately get 0 at exam score and
cannot take the exam. Teachers have to update the results after 2 weeks of the final exam. Students
must inform teachers about the mistakes in their results and every change must be carried out in 1
week.

Business rules:
● The system enforces that students who do not meet a minimum 75% attendance rate are
disqualified from taking the final exams. Attendance score=10 - 0,5*late - ( absence -
absence_with_permission )*2

● Percentages of letter grades: A (85-100%), B (70-84%), C (55-69%), D (40-54%), and F (<40%).

● Attendance weighs 10%, assignments 20%, and exams 70%. Total Grade = (Assignment Score ×
0.2) + (Attendance score × 0.1) + (Exams Score × 0.7).

CLASS SCHEDULING

Business process: The class scheduling process in an educational institution involves systematically
planning, organizing, and managing class times, locations, and resources to optimize the schedule for
students and faculty. It begins by defining scheduling objectives and policies, which include setting
guidelines around class hours, class date, class size limits, with goals like maximizing room utilization,
reducing conflicts. Next, a preliminary schedule is developed by assigning time slots, ensuring no
scheduling conflicts for students. This draft schedule is reviewed by stakeholders, adjusted based on
feedback, and formally approved. The finalized schedule is published to students and faculty through
the institution’s online portal, which opens registration and offers support as needed during this period.
Throughout the term, enrollment and attendance are monitored to allow for adjustments like opening
additional sections, combining small classes, or handling changes in room assignments. At the end of the
term, data on scheduling effectiveness, resource utilisation, and feedback are analyzed to document
improvements, refine policies, and enhance scheduling processes for the future.

Business rules:

● Ensure required courses don’t conflict

● Each class has its own capacity. When classes are full, cannot add any students or make any
arrangements.

STUDENT ENROLLMENT:

Business process

1. Student Registration:

● When a student wishes to enroll, they provide personal details (name, student ID, date of birth,
email, etc.

● Once approved, students use their student ID to enroll the subjects and classes which they want
to learn in one semester.
● Students have 2 weeks to enroll the subjects that they want to learn in the next semester as well
as the class for that subject. After these 2 weeks, they have one more week to change their
aspiration.The student is then added to the class list for their selected subjects.

2. Class Selection:

Capacity Check:

● Scenario 1: Class is Available: If the class has available spots, the student’s registration proceeds
normally.

● Scenario 2: Class is Full:

▪ Notification: If the class is full, the system notifies the student immediately, the
enrollment status becomes “fail”.

3. Final Course Confirmation:

Student Choice: After successful enrollment, the student receives their course schedule, which includes
their selected subjects, classes, times, and locations

Business rule

● A student can enroll in at least 12 credits per semester and a maximum of 28 credits. If enroll
less than 12 credits, student will not be able to register for any class in that semester (all
enrollment status of them become “fail’’) and all other column will be set to ‘null’ value

● Students can only study 1 subject 1 time in a semester .

ATTENDANCE TRACKING

Business process

1. Class Setup:

● Teachers set up their course attendance system using the university’s digital platform or
a manual process (e.g., class roll calls or apps).

● Teacher Action: At the beginning of each class, the teacher records student attendance
by paper or calling, late students can request their teacher to change their attendance
status from absent to late.

● Students with absence with permission status will not lose any attendance
score( consider as not late)

● System Update: The attendance system records whether students are present, absent,
or late.
2. Monitoring & Notifications:

● Real-Time Alerts: If a student misses a class or exceeds the attendance threshold, the
system sends automatic notifications to the student.

● Teacher Reports: Teachers review weekly attendance reports for follow-up actions.

2. Excused Absence Requests:

● Student Submission: Students submit documentation for excused absences through the
system (e.g., medical notes).

● Teacher Review: Teachers or administrators review and approve or reject these


requests.

● At the end of the term, a final attendance report is generated for student records and
academic evaluations.

Business Rule

Minimum Attendance Requirement:

● Students must attend at least 75% of all scheduled classes to be eligible to take final
exams or receive credit for the course. ( If their attendance score are below 7.5, their
exam score will become 0 ).

2. Database design
ERD:
Relational Database Design:

Table and columns:


- Parent ( Parent_ID, Parent_Name, Parent_Phone, Relationship_Type, Parent_Email,
Parent_Address )

- Student ( Student_ID, Student_name, Date_of_join, Email, Phone, Address, Gender, Dob)

- Supervise ( Parent_ID, Student_ID )

- Enrollment ( Enroll_ID, Student_ID, Subject_ID, Exams Score, Assignment Score,


Attendance score, Semester, Late, Absence, Absence_with_permission, Enroll_date,
Enrollment_status, Letter_score, Class_id)

- Subject ( Subject_id, Subject_name, Credits )

- Class ( Class_ID, Capacity, Class_date, Class_start_time , Class_end_time, Building,


Class_type, Teacher_ID, Subject_ID, Number_of_students, Semester )

- Teacher ( Teacher_ID, Teacher_name, Hire_date, Phone, Email, Salary )

- Teaching ( Teacher_ID, Subject_ID )

3. Application Description
The School Management System offers several key functionalities to streamline academic and
extracurricular processes:

Functionalities

1. Student Enrollment:

o Users: Students

o Input: Student_id, semester

o Output: Student profile, enrollment confirmation, subject information

2. Attendance Tracking:

o Users: Students
o Input: Class name

o Output: List of attendance status (present, absent, late)

3. Result System:

o Users: Student, Parent

o Input: Subject ID, Semester

o Output: Final grades (Both number and letter). Semester

4. Class Timetable:

o Users: Student

o Input: Subject ID, class type (Lecture, Lab)

o Output: Class start time, class end time, class date, class ID, semester

5. Managing student:

o Users: Teacher

o Input: Subject ID

o Output: Student ID, student name, attendance status, assignment grade, exam grades, attendance
date, total grade value

Installed Rule:
1. Attendance score=10 - 0,5*late - ( absence - absence_with_permission )*2
- Created a trigger to automatically update the attendance score after the teachers
insert all the attendance status ( late, absence, absence with permission)

create or replace function update_diem_tham_gia()


returns trigger as $$
begin update enrollment
set attendance_score= 10- 0.5*NEW.late - (NEW.absence-
NEW.absence_with_permission)*2
where student_id=NEW.student_id and semester=NEW.semester and
subject_id=NEW.subject_id;
return new;
end;
$$ language plpgsql;
create or replace trigger auto_diem_tham_gia
after insert on enrollment
for each row
execute function update_diem_tham_gia();
2. The system enforces that students who do not meet a minimum 75% attendance rate
are disqualified from taking the final exams.

- Created a function to check if students have their attendance score under 7.5 or not. If
students have less then 7.5 attendance score the exam score will become zero.
Method 1:
create or replace function auto_check_khong_duoc_thi(id_monhoc
varchar(10),semesterx varchar(6))
returns void as $$
declare id_hs varchar(10);
att_score float;
begin
for id_hs in (select student_id from enrollment where subject_id=id_monhoc and
semester=semesterx and enrollment_status='success') loop
select attendance_score into att_score from enrollment where student_id=id_hs and
subject_id=id_monhoc and semester=semesterx;
if att_score<7.5 then update enrollment set exam_score=0 where student_id=id_hs and
subject_id=id_monhoc and semester=semesterx;
end if;
end loop;
end;
$$ language plpgsql;
- The performance of the 1st method is pretty bad because the function using
loop and each loop contain an amount of queries, furthermore the using of
where without index (in a large database) cost lots of performance. Finally this
block only deals with 1 student each loop so the execution time is not short.

- Second method:
create or replace function update_exam_score(subject_id_input VARCHAR,
semester_input VARCHAR)
returns void AS $$
begin
update enrollment
set exam_score = 0
where subject_id = subject_id_input
and semester = semester_input
and attendance_score < 7.5
and enrollment_status='success';
and;
$$ LANGUAGE plpgsql;
This method is faster than the first 1 because it does not use any loop and its can deal
with multiple record at the same time, the function only need to execute the query
once.
3. Attendance weighs 10%, assignments 20%, and exams 70%. Created a function to
calculate the letter score.
create or replace function update_diem_chu(id_monhoc varchar(10),semesterx varchar(6))
returns void as $$
declare id_hs varchar(10);
final_score float;
begin
for id_hs in (select student_id from enrollment where subject_id=id_monhoc and
semester=semesterx and enrollment_status='success') loop
select 0.1*attendance_score + 0.2*assignment_score + 0.7*exam_score into final_score
from enrollment where student_id=id_hs and subject_id=id_monhoc and
semester=semesterx and enrollment_status='success';
if final_score>=8.5 then update enrollment set letter_score='A' where student_id=id_hs and
subject_id=id_monhoc and semester=semesterx and enrollment_status='success';
elseif final_score<8.5 and final_score>=7 then update enrollment set letter_score='B' where
student_id=id_hs and subject_id=id_monhoc and semester=semesterx and
enrollment_status='success';
elseif final_score<7 and final_score>=5.5 then update enrollment set letter_score='C' where
student_id=id_hs and subject_id=id_monhoc and semester=semesterx and
enrollment_status='success';
elseif final_score<5.5 and final_score>=4 then update enrollment set letter_score='D' where
student_id=id_hs and subject_id=id_monhoc and semester=semesterx and
enrollment_status='success';
elseif final_score<4 then update enrollment set letter_score='F' where student_id=id_hs
and subject_id=id_monhoc and semester=semesterx and enrollment_status='success';
end if;
end loop;
end;
$$ language plpgsql;

4. When classes are full, cannot add any students or make any arrangement.
- Created a trigger before insert on enrollment to check if the current number of
students in the class is below the capacity or not. If the class is not full, insert
the new students, set enrollment status=’success’, enroll_date = current date
and increase the number of students in that class by 1, else set
enrollment_status = ‘fail’.

create or replace function check_capa()


returns trigger as $$
declare so_hs_hien_tai int;
capa int;
begin
select count(*) into so_hs_hien_tai from enrollment where semester=NEW.semester and
subject_id=NEW.subject_id and class_id=NEW.class_id and enrollment_status='success';
select capacity into capa from class where semester=NEW.semester and
class_id=NEW.class_id;
if so_hs_hien_tai<capa then update class set number_of_students=so_hs_hien_tai+1 where
semester=NEW.semester and class_id=NEW.class_id;
NEW.enrollment_status:='success';
NEW.enroll_date:=CURRENT_DATE;
return NEW;
else NEW.enrollment_status:='fail';
return NEW;
end if;
end;
$$ language plpgsql;
create or replace trigger cap_nhat_hs_trigger
before insert on enrollment
for each row
execute function check_capa();

5. Credits check : (If currently students have 28 registered credits they cannot enroll to
others subject, still allow to show the enrollment info with enroll_status error)

create or replace function gioi_han_tin()


returns trigger as $$
declare tong_so_tin int;
sotin int;
begin
select sum(credits) into tong_so_tin from enrollment e left join subject using(subject_id)
where student_id=NEW.student_id and semester=NEW.semester and
enrollment_status='success';
select credits into sotin from subject where subject_id=NEW.subject_id;
if tong_so_tin + sotin >28 then NEW.enrollment_status:='fail';
NEW.enroll_date:=NULL;
end if;
return NEW;
end;
$$ language plpgsql;
create or replace trigger kiem_tra_gh_tin
before insert on enrollment
for each row
execute function gioi_han_tin();

6. Function to check students who do not have enough credits (<12 credits), all the
enroll status of these students will become fail.

create or replace function ko_du_tin(kihoc varchar(6))


returns void as $$
declare ma_hs varchar(10);
tong_tin int;
begin
for ma_hs in (select student_id from enrollment where semester=kihoc) loop
select sum(credits) into tong_tin from enrollment left join subject using (subject_id) where
student_id=ma_hs and semester=kihoc;
if tong_tin<12 then
update enrollment set enrollment_status='fail' where student_id=ma_hs and
semester=kihoc;
update class set number_of_students=number_of_students - 1 where class_id in (select
class_id from enrollment where student_id=ma_hs);
end if;
end loop;
end;
$$ language plpgsql;

7. Trigger to prevent courses conflict


create or replace function check_class_conflict()
returns trigger as $$
declare lophoc varchar(10);
start_time time;
end_time time;
day varchar;
new_start_time time;
new_end_time time;
new_day varchar;
begin
NEW.enrollment_status='success';
for lophoc in (select class_id from enrollment where student_id=NEW.student_id and
semester=NEW.semester and enrollment_status=’success’) loop
select class_start_time,class_end_time, class_date into start_time, end_time, day from class
where class_id=lophoc;
select class_start_time,class_end_time, class_date into new_start_time, new_end_time,
new_day from class where class_id=NEW.class_id;
if day=new_day and new_start_time>= start_time and new_start_time<= end_time or
day=new_day and new_end_time>= start_time and new_end_time<= end_time or
new_start_time < start_time and end_time < new_end_time then NEW.enrollment_status='fail';
return NEW;
end if;
end loop;
return NEW;
end;
$$ language plpgsql;
create or replace trigger check_conflict
before insert on enrollment
for each row
execute function check_class_conflict();
8. (exam_score, assignment_score, attendance_score, enroll_date, late, absence,
absence_with_permission, letter_score) are set to NULL whenever enrollment_status
is updated to 'fail'.
CREATE OR REPLACE FUNCTION set_null_on_fail()
RETURNS TRIGGER AS $$
BEGIN
-- Check if enrollment_status is being updated to 'fail'
IF NEW.enrollment_status = 'fail' THEN
NEW.exam_score = NULL;
NEW.assignment_score = NULL;
NEW.attendance_score = NULL;
NEW.enroll_date = NULL;
NEW.late = NULL;
NEW.absence = NULL;
NEW.absence_with_permission = NULL;
NEW.letter_score = NULL;
END IF;
-- Return the updated row
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

CREATE OR REPLACE TRIGGER trigger_set_null_on_fail


BEFORE UPDATE ON enrollment
FOR EACH ROW
EXECUTE FUNCTION set_null_on_fail();

5. Group member and task of each member


Student’s name Student’s ID Email Task

Trần Lê Minh 20235979 minh.tl235979


(Leader) @sis.hust .edu.
vn

Lê Huy Dũng 20235919 dung.lh235919


@sis.hus
t.edu.vn

Hoàng Quốc 20235903 cuong.hq2359


Cường [email protected]
ust.edu.vn
Nguyễn Hữu 20236005 tu.nht236005@
Tuấn Tú sis.hust.
edu.vn

You might also like