Changes between Version 12 and Version 13 of P1
- Timestamp:
- 06/24/26 09:55:03 (40 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
P1
v12 v13 8 8 9 9 10 == Data Requirements 10 11 11 == Data Requirements ==12 • University: This entity stores information about universities. We need it to know which faculties belong to which university.12 === '''University''' 13 This entity stores information about universities. It defines which faculties belong to which university and tracks affiliations with professors. 13 14 14 º Candidate keys: Id (primary key).15 '''Candidate keys:''' id (primary key). 15 16 16 º Attributes: 17 '''Attributes:''' 17 18 18 Id – number, required, unique19 '''id''' – serial (integer), required, unique 19 20 20 Name – text, required, max 255 characters 21 '''name''' – varchar(255), required 21 22 22 Location – text, optional, max 255 characters 23 '''location''' – varchar(100), optional 23 24 24 isprivate – boolean, required 25 '''isprivate''' – boolean, required (mapped to is_private on the diagram) 25 26 26 ---- 27 === '''Faculty''' 28 Represents a faculty within a university. It organizes students, professors, and subjects. Each faculty belongs to one university. 27 29 28 • Faculty: Represents a faculty inside a university. It helps organize students, professors, and subjects within that faculty. Each faculty belongs to one university.30 '''Candidate keys:''' id (primary key). 29 31 30 º Candidate keys: Id (primary key). 32 '''Attributes:''' 31 33 32 º Attributes: 34 '''id''' – serial (integer), required, unique 33 35 34 Id – number, required, unique 36 '''name''' – varchar(255), required 35 37 36 Name – text, required, max 255 characters 38 '''location''' – varchar(100), optional 37 39 38 Location – text, optional, max 255 characters 40 '''study_field''' – study_field_enum, required 39 41 40 Study_field – text, optional, max 255 characters 42 '''university_id''' – integer, required, foreign key to University (on delete cascade) 41 43 42 University_Id – number, required, foreign key to University 44 === '''Professor''' 45 This entity stores professor details. Each professor belongs to a specific faculty and can be associated with universities, students (advice sessions), and subject enrollments. 43 46 44 ---- 45 • Professor: This entity stores professors. Each professor works in a specific faculty, can guide students through advice sessions, and is assigned to teach subjects inside student enrollments. 47 '''Candidate keys:''' id (primary key). 46 48 47 º Candidate keys: Id (primary key). 49 '''Attributes:''' 48 50 49 º Attributes: 51 '''id''' – serial (integer), required, unique 50 52 51 Id – number, required, unique 53 '''name''' – varchar(255), required 52 54 53 Name – text, required, max 255 characters 55 '''surname''' – varchar(255), optional 54 56 55 Surname – text, optional, max 255 characters 57 '''age''' – integer, optional, range 18–80 (constrained via CHECK constraint in SQL) 56 58 57 Age – number, optional, 25–100 59 '''facultyid''' – integer, required, foreign key to Faculty (on delete cascade) 58 60 59 Faculty_Id – number, required, foreign key to Faculty 61 === '''Student''' 62 This entity stores student details. Each student is enrolled in a faculty, can take subjects, and can have advice sessions with professors. 60 63 61 ---- 64 '''Candidate keys:''' id (primary key), studentindex (unique key). 62 65 63 • Student: This entity stores students. Each student belongs to a faculty, can enroll in subjects, and can interact with professors during advice sessions. 66 '''Attributes:''' 64 67 65 º Candidate keys: Id (primary key). 68 '''id''' – serial (integer), required, unique 66 69 67 º Attributes: 70 '''name''' – varchar(255), required 68 71 69 Id – number, required, unique 72 '''surname''' – varchar(255), optional 70 73 71 Name – text, required, max 255 characters 74 '''location''' – varchar(100), optional 72 75 73 Surname – text, optional, max 255 characters 76 '''studentindex''' – integer, required, unique (mapped to Index on the diagram) 74 77 75 Location – text, optional, max 255 characters 78 '''facultyid''' – integer, required, foreign key to Faculty (on delete restrict) 76 79 77 Index – number, required, unique 80 === '''Subject''' 81 This entity stores the courses or subjects offered by a faculty. Students can enroll in these subjects. 78 82 79 Faculty_Id – number, required, foreign key to Faculty 83 '''Candidate keys:''' id (primary key). 80 84 81 ---- 85 '''Attributes:''' 82 86 83 • Subject: This entity stores courses or subjects offered by a faculty. Students can enroll in these subjects. 87 '''id''' – serial (integer), required, unique 84 88 85 º Candidate keys: Id (primary key). 89 '''name''' – varchar(255), required 86 90 87 º Attributes: 91 '''semester''' – integer, optional, range 1–8 88 92 89 Id – number, required, unique 93 '''credits''' – integer, optional, range 1–10 90 94 91 Name – text, required, max 255 characters 95 '''facultyid''' – integer, required, foreign key to Faculty (on delete restrict) (implicitly handles the offers relation) 92 96 93 Semester – text, optional, e.g., "Fall", "Spring" 97 === '''Student_Subject''' 98 This entity represents a specific student enrollment in a subject (course instance). It tracks grades, attendance, and status. It also acts as the central link resolving which professor teaches this specific instance to the student. 94 99 95 Credits – number, required, 1–15 100 '''Candidate keys:''' ss_id (primary key). 96 101 97 Faculty_Id – number, required, foreign key to Faculty 102 '''Attributes:''' 98 103 99 ---- 104 '''ss_id''' – serial (integer), required, unique (mapped to ss_id on the diagram) 100 105 101 • Student_Subject: This entity represents a specific student enrollment in a subject. It tracks grades, attendance, and status. It also links the specific professor who teaches this instance of the course. 106 '''student_id''' – integer, required, foreign key to Student (on delete cascade) 102 107 103 º Candidate keys: ssId (primary key). 108 '''subject_id''' – integer, required, foreign key to Subject (on delete cascade) 104 109 105 º Attributes: 110 '''professor_id''' – integer, required, foreign key to Professor (on delete restrict) (materializes the assignTo relationship from the diagram) 106 111 107 ssId – number, required, unique 112 '''enrollment_date''' – date, required, defaults to CURRENT_DATE (mapped to Enrollment_Date) 108 113 109 Final_Grade – number, optional, 6–10 114 '''status''' – varchar(20), optional, defaults to 'Enrolled' 110 115 111 Status – text, optional, e.g., "Enrolled", "Passed", "Failed" 116 '''final_grade''' – integer, optional (mapped to Final_Grade) 112 117 113 Enrollment_Date – date, required 118 '''absences_count''' – integer, optional, defaults to 0 (mapped to Abesense_Count on the diagram) 114 119 115 Absence_Count – number, optional, 0–100 120 === '''Advice''' 121 This associative table tracks mentorship history and formal guidance sessions between professors and students. 116 122 117 Student_Id – number, required, foreign key to Student 123 '''Candidate keys:''' Composite primary key (student_id, professor_id, start_date). 118 124 119 Subject_Id – number, required, foreign key to Subject 125 '''Attributes:''' 120 126 121 Professor_Id – number, required, foreign key to Professor 127 '''student_id''' – integer, required, foreign key to Student (on delete cascade) 122 128 123 ---- 129 '''professor_id''' – integer, required, foreign key to Professor (on delete cascade) 124 130 125 • Advice: This ternary associative relationship entity tracks the history of formal advice and mentorship sessions between professors and students. 131 '''start_date''' – date, required (mapped to start date) 126 132 127 º Candidate keys: Composite key made of (student_id, professor_id, start_date). 133 '''end_date''' – date, optional (mapped to end_date) 128 134 129 º Attributes: 135 === '''Affiliated''' 136 This table materializes the relationship between Professors and Universities. While drawn as a 1:N relationship (affiliated_with), it is physically implemented as a Many-to-Many bridge table to allow flexible multi-university affiliations. 130 137 131 student_id – number, required, foreign key to Student 138 '''Candidate keys:''' Composite primary key (university_id, professor_id). 132 139 133 professor_id – number, required, foreign key to Professor 140 '''Attributes:''' 134 141 135 start_date – date, required, unique part of the key 142 '''university_id''' – integer, required, foreign key to University (on delete cascade) 136 143 137 end_date – date, optional 138 139 status – text, optional, e.g., "Active", "Completed" 140 141 ---- 142 143 • Professor_Subject: This bridge entity materializes the Many-to-Many relationship between professors and the subjects they are certified or eligible to teach. 144 145 º Candidate keys: Composite key made of (subject_id, professor_id). 146 147 º Attributes: 148 149 subject_id – number, required, foreign key to Subject 150 151 professor_id – number, required, foreign key to Professor 144 '''professor_id''' – integer, required, foreign key to Professor (on delete cascade) 152 145 153 146 == Entity-Relationship Model History
