= UseCase3001Implementation – Enroll in Subject **Initiating actor:** Student **Other actors:** None **Description:** Student enrolls in a subject offered by their faculty and selects a specific professor teaching that course instance. **Scenario:** 1. System displays Student Menu. 2. Student selects Enroll in Subject. 3. System lists all students → Student selects their Student ID. 4. System lists available subjects for the student's faculty: {{{ SELECT s.Id, s.Name FROM Subject s JOIN Student st ON s.Faculty_Id = st.Faculty_Id WHERE st.Id = ?; }}} Student selects a Subject ID. 5. System lists all available professors for the chosen subject: {{{ SELECT p.Id, p.Name, p.Surname FROM Professor p JOIN Subject s ON p.Faculty_Id = s.Faculty_Id WHERE s.Id = ?; }}} Student selects a Professor ID. 6. System checks if the student is already enrolled in this subject: {{{ SELECT * FROM Student_Subject WHERE Student_Id = ? AND Subject_Id = ?; }}} 7. If not enrolled, system inserts the new enrollment record into the database: {{{ INSERT INTO Student_Subject(Student_Id, Subject_Id, Professor_Id, Status, Enrollment_Date, Absences_Count) VALUES (?, ?, ?, 'PASSED', CURRENT_DATE, 0); }}} 8. System confirms successful enrollment. [[Image(enrollSubject1.png, 800px)]] [[Image(enrollSubject2.png, 800px)]] [[Image(enrollSubject3.png, 800px)]] [[Image(enrollSubject4.png, 800px)]]