| Version 30 (modified by , 29 hours ago) ( diff ) |
|---|
Relational Design
Notation
- Primary keys are enclosed in [ ] and underlined.
- Foreign keys are marked with * at the end of their name and the referenced entity is written in parentheses.
Tables
University ( Id, Name, Location, is_private )
Faculty ( Id, University_Id* (University), Name, Location, Study_field )
Professor ( Id, Faculty_Id* (Faculty), Name, Surname, Age )
Student ( Id, Faculty_Id* (Faculty), Name, Surname, Location, Student_Index )
Subject ( Id, Faculty_Id* (Faculty), Name, Semester, Credits )
Student_Subject ( [Student_Id* (Student), Subject_Id* (Subject), Ss_Id], Professor_Id* (Professor), Enrollment_Date, Status, Final_Grade, Abesense_Count )
Advice ( [Student_Id* (Student), Professor_Id* (Professor), Start_Date], End_Date )
Affiliated ( [University_Id* (University), Professor_Id* (Professor)] )
Teach ( [Professor_Id* (Professor), Subject_Id* (Subject)] )
DDL script for creating the database schema and objects:
DML script for inserting data in the tables
Relational diagram made in DBeaver
AI Usage for Relational Design
Name of AI service/solution that was used: ChatGPT (OpenAI)
Type of service/subscription: Free Tier
Final result: I reviewed my updated conceptual ER model from Phase 1 to correctly map all entities, weak entities, and relationships into a logical relational database schema. The weak entity Student_Subject was correctly materialized with a composite primary key formed by its owner entities' keys plus its discriminator (Student_Id, Subject_Id, Ss_Id), while all M:N relationships (Advises, affiliated_with, Teach) were materialized as bridge tables.
Final Result
Tables
University ( Id, Name, Location, is_private )
Faculty ( Id, University_Id* (University), Name, Location, Study_field )
Professor ( Id, Faculty_Id* (Faculty), Name, Surname, Age )
Student ( Id, Faculty_Id* (Faculty), Name, Surname, Location, Student_Index )
Subject ( Id, Faculty_Id* (Faculty), Name, Semester, Credits )
Student_Subject ( [Student_Id* (Student), Subject_Id* (Subject), Ss_Id], Professor_Id* (Professor), Enrollment_Date, Status, Final_Grade, Abesense_Count )
Advice ( [Student_Id* (Student), Professor_Id* (Professor), Start_Date], End_Date )
Affiliated ( [University_Id* (University), Professor_Id* (Professor)] )
Teach ( [Professor_Id* (Professor), Subject_Id* (Subject)] )
DDL script for creating the database schema and objects:
DML script for inserting data in the tables
Relational diagram made in DBeaver
Results in details / description:
Schema Mapping & Normalization Review: All conceptual entities from Phase 1 were mapped to relations. Foreign keys were introdu
Entire AI usage log:
Schema Mapping & Normalization Review: All entities from Phase 1 were mapped to relations. Foreign keys were introduced to represent 1:N relationships (University_Id in Faculty, Faculty_Id in Professor, Student, and Subject).
Weak Entity Materialization: The weak entity Student_Subject was mapped by forming a composite primary key consisting of its discriminator (Ss_Id) along with the primary keys of its owner entities (Student_Id and Subject_Id). The regular 1:N relationship with Professor (assignTo) was materialized via a foreign key Professor_Id in this table.
Relationship Materialization:
- The M:N relationship
Adviseswith attributes (start_date,end_date) was mapped to theAdvicetable with a composite primary key (Student_Id,Professor_Id,Start_Date). - The M:N relationship
affiliated_withwas mapped to theAffiliatedbridge table with composite primary key (University_Id,Professor_Id). - The M:N relationship
Teachwas mapped to theTeachbridge table with composite primary key (Professor_Id,Subject_Id).
Attachments (10)
- schema_creation1.sql (2.1 KB ) - added by 6 months ago.
- data_load1.sql (1.2 KB ) - added by 6 months ago.
- relational_schema.png (99.0 KB ) - added by 2 months ago.
- relational_schema2.png (100.3 KB ) - added by 2 months ago.
- relational_schema3.png (102.8 KB ) - added by 2 months ago.
- schema_creation.sql (3.6 KB ) - added by 7 days ago.
- data_load.sql (1.5 KB ) - added by 7 days ago.
- schema_creation3.sql (3.5 KB ) - added by 29 hours ago.
- data_load.3.sql (1.5 KB ) - added by 29 hours ago.
- relational_schema4.png.png (99.6 KB ) - added by 29 hours ago.
Download all attachments as: .zip


