The E-R Model for the University Accommodation Office
1. Identify entity types with brief description
Hall : All dorm buildings
Room : All rooms in all halls
Student : All students renting or waiting
Course : One course is recorded for each student
EmergencyContact: Each student should have one emergency contact
2. Relationship Types with attributes and multiplicity
Hall (1..1) Has (1..*) Room
A hall has many rooms.
A room can only be in one hall.
Student (0..*) Leases (0..*) Room
Attributes: Start, End
A student can rent only one room for any specific period of time
One room is leased to one student at any given time
Old leases are still stored in the database
Students can sign new leases before their current leases expired
Student (0..*) WaitFor (0..*) Room
Attribute: dateOnWaitingList
One student can request multiple rooms for different time spans
One room could be requested by multiple students, even for the same time span
Student (1..*) IsEnrolledIn (1) Course
Only one course is recorded for one student, and not all courses are stored
Each student must be enrolled in one course
Student (1..*) IsRelatedTo (0..1) EmergencyContact
Attributes: relationship
One student should have one contact
One person could be contact for multiple students
3. Entity Type Details
Hall
HallNo
Address
Phone: Multi-Value
Name
Primary Key: HallNo
Alternate Keys: Address
Name
Each hall could have more than one phone number
Different halls cannot share one phone number
Different halls have different names and addresses
Room
PlaceNo
RoomNo
Rent
Primary Key: PlaceNo
Alternate Keys: None
Student
MatricNo
Name: Composite (first, middle, last)
Birthday: Composite (year, month, day)
Phone
Address: Composite (Street, City, State, ZipCode)
Primary Key: MatricNo
Alternate Keys: None
Course
CourseID
Title
Department
CourseLeader
Primary Key: CourseID
Alternate Keys: Title
EmergencyContact:
FirstName
LastName
Phone
Address: Optional
4. E-R Diagram
Hall
HallNo
1
Has
1..*
Room
PlaceNo
0..* 0..*
WaitFor Leases
0..* 0..*
Student
MatricNo
1..* 1..*
IsEnrolledIn IsRelatedTo
0..1
1
Course Contact
CourseID ID