= UseCase3001 – Enroll in Subject **Initiating actor:** Student **Other actors:** None **Description:** A student enrolls in a subject offered by their faculty and selects a specific professor who teaches that course instance. **Scenario:** 1. Student logs into the system and selects “Enroll in Subject.” 2. System displays available subjects and the professors teaching them at the student's faculty: {{{ SELECT s.Id AS Subject_Id, s.Name AS Subject_Name, p.Id AS Professor_Id, p.Name AS Professor_Name, p.Surname AS Professor_Surname FROM Subject s JOIN Professor p ON p.Faculty_Id = s.Faculty_Id JOIN Student st ON st.Faculty_Id = s.Faculty_Id WHERE st.Id = :student_id; }}} 3. Student chooses a subject and the desired professor, then clicks “Enroll.” 4. System checks if the student is already enrolled in this subject: {{{ SELECT * FROM Student_Subject WHERE Student_Id = :student_id AND Subject_Id = :subject_id; }}} 5. If not enrolled, system inserts the enrollment record: {{{ INSERT INTO Student_Subject(Student_Id, Subject_Id, Professor_Id, Status, Enrollment_Date, Absences_Count) VALUES (:student_id, :subject_id, :professor_id, 'PASSED', :enrollment_date, 0); }}} 6. System confirms enrollment and updates student's schedule.