Changes between Version 16 and Version 17 of ERModel
- Timestamp:
- 09/03/26 17:52:13 (7 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ERModel
v16 v17 1 2 1 == '''Entity-Relationship Model v01''' 3 4 2 5 3 == Diagram 6 4 7 5 [[Image(ERModel_v1.3.png)]] 8 9 6 10 7 == Data Requirements … … 26 23 27 24 === '''Faculty''' 28 Represents a faculty within a university. It organizes students, professors, and subjects. Each faculty belongs to one university.25 Represents a faculty within a university. It organizes students, professors, and subjects. 29 26 30 27 '''Candidate keys:''' id (primary key). … … 40 37 '''study_field''' – study_field_enum, required 41 38 42 '''university_id''' – integer, required, foreign key to University (on delete cascade)43 44 39 === '''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.40 This entity stores professor details. 46 41 47 42 '''Candidate keys:''' id (primary key). … … 55 50 '''surname''' – varchar(255), optional 56 51 57 '''age''' – integer, optional, range 18–80 (constrained via CHECK constraint in SQL) 58 59 '''facultyid''' – integer, required, foreign key to Faculty (on delete cascade) 52 '''age''' – integer, optional, range 18–80 60 53 61 54 === '''Student''' 62 This entity stores student details. Each student is enrolled in a faculty, can take subjects, and can have advice sessions with professors.55 This entity stores student details. 63 56 64 57 '''Candidate keys:''' id (primary key), studentindex (unique key). … … 76 69 '''studentindex''' – integer, required, unique (mapped to Index on the diagram) 77 70 78 '''facultyid''' – integer, required, foreign key to Faculty (on delete restrict)79 80 71 === '''Subject''' 81 This entity stores the courses or subjects offered by a faculty. Students can enroll in these subjects.72 This entity stores the courses or subjects offered by a faculty. 82 73 83 74 '''Candidate keys:''' id (primary key). … … 89 80 '''name''' – varchar(255), required 90 81 91 '''semester''' – integer, optional, range 1–8 82 '''semester''' – integer, optional, range 1–8 92 83 93 84 '''credits''' – integer, optional, range 1–10 94 85 95 '''facultyid''' – integer, required, foreign key to Faculty (on delete restrict) (implicitly handles the offers relation) 96 97 === '''Student_Subject''' 98 This entity represents a weak entity that depends on both Student and Subject. It tracks a specific student enrollment in a subject (course instance), including grades, attendance, and status, while resolving which professor teaches this specific instance. 99 100 '''Primary Key:''' Composite key consisting of (student_id, subject_id, ss_id). 86 === '''Student_Subject (Weak Entity)''' 87 This entity represents a weak entity that depends on both Student and Subject for its identity. It tracks a specific student enrollment in a subject (course instance). 101 88 102 89 '''Discriminator (Partial Key):''' ss_id. 103 90 91 '''Composite Primary Key:''' Composed of Student key + Subject key + ss_id. 92 104 93 '''Attributes:''' 105 94 106 '''ss_id''' – integer, required. Acts as the discriminator (partial key) for the weak entity. It uniquely identifies multiple enrollments of the same student in the same subject (e.g., if a student retakes a course). 107 108 '''student_id''' – integer, required, identifying foreign key to Student (on delete cascade). Part of the composite primary key. 109 110 '''subject_id''' – integer, required, identifying foreign key to Subject (on delete cascade). Part of the composite primary key. 111 112 '''professor_id''' – integer, required, regular foreign key to Professor (on delete restrict) (materializes the assignTo relationship from the diagram). 95 '''ss_id''' – integer, required. Acts as the discriminator (partial key/dashed underline) for the weak entity. It uniquely identifies multiple enrollments of the same student in the same subject. 113 96 114 97 '''enrollment_date''' – date, required, defaults to CURRENT_DATE (mapped to Enrollment_Date). … … 120 103 '''absences_count''' – integer, optional, defaults to 0 (mapped to Abesense_Count on the diagram). 121 104 105 == Relationships 122 106 107 === '''part_of''' 108 Binary 1:N relationship between University (1) and Faculty (N). Indicates which university a faculty belongs to. 123 109 124 === ''' Advice'''125 This associative table tracks mentorship history and formal guidance sessions between professors and students.110 === '''employs''' 111 Binary 1:N relationship between Faculty (1) and Professor (N). Tracks which faculty employs a professor. 126 112 127 '''Candidate keys:''' Composite primary key (student_id, professor_id, start_date). 113 === '''enrolled_in''' 114 Binary 1:N relationship between Faculty (1) and Student (N). Tracks which faculty a student is enrolled in. 115 116 === '''offers''' 117 Binary 1:N relationship between Faculty (1) and Subject (N). Defines which subjects are offered by a faculty. 118 119 === '''affiliated_with''' 120 Binary M:N relationship between University and Professor. Allows a professor to be affiliated with multiple universities. 121 122 === '''Advises''' 123 Binary M:N relationship between Professor and Student tracking mentorship. 128 124 129 125 '''Attributes:''' 130 126 131 '''st udent_id''' – integer, required, foreign key to Student (on delete cascade)127 '''start_date''' – date, required 132 128 133 ''' professor_id''' – integer, required, foreign key to Professor (on delete cascade)129 '''end_date''' – date, optional 134 130 135 '''start_date''' – date, required (mapped to start date) 131 === '''Teach''' 132 Binary M:N relationship between Professor and Subject. Indicates which subjects a professor can teach. 136 133 137 '''end_date''' – date, optional (mapped to end_date) 134 === '''enrolls''' 135 Identifying 1:N relationship between Student (1) and weak entity Student_Subject (N). 138 136 139 === ''' Affiliated'''140 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.137 === '''has''' 138 Identifying 1:N relationship between Subject (1) and weak entity Student_Subject (N). 141 139 142 '''Candidate keys:''' Composite primary key (university_id, professor_id). 143 144 '''Attributes:''' 145 146 '''university_id''' – integer, required, foreign key to University (on delete cascade) 147 148 '''professor_id''' – integer, required, foreign key to Professor (on delete cascade) 140 === '''assignTo''' 141 Regular 1:N relationship between Professor (1) and weak entity Student_Subject (N). Indicates which professor is assigned to a specific course instance enrollment. 149 142 150 143 == Entity-Relationship Model History 151 144 152 v1: First version of the conceptual ER model including University, Faculty, Professor, Student, Subject, Student_Subject weak entity, advice mentorship tracking, and professor_subject competency mapping. Attributes, candidate keys, nullability constraints, and precise entity relationships defined. 145 v1: First version of the conceptual ER model including University, Faculty, Professor, Student, Subject, Student_Subject weak entity, and precise entity relationships. 146 147 v1.1: Corrected conceptual ER representations: removed all foreign keys from entity attributes, correctly specified weak entity discriminator and identifying relationships, converted bridge tables (Affiliated, Advises) into relationship types with attributes.
