Dorm.

1. Identify the entities
2. Identify their attributes
3. Identify the degree of their relationship
4. Identify their cardinalities
5. Identify Constraint

3 answers

1. Entities:
- Dorm
- Student
- Room

2. Attributes:
- Dorm: name, address, capacity
- Student: ID, name, gender, contact number
- Room: number, capacity

3. Degree of Relationship:
- The Dorm has a relationship with the Student and the Room entities.

4. Cardinalities:
- Dorm-Student relationship: One Dorm can have many Students, and each Student can only belong to one Dorm. (1-to-many)
- Dorm-Room relationship: One Dorm can have many Rooms, and each Room can only belong to one Dorm. (1-to-many)

5. Constraints:
- Capacity Constraint: The number of students in a Dorm cannot exceed its capacity.
- Unique Room Constraint: Each Room in a Dorm must have a unique number.
University Dorm.
1. Identify the entities
2. Identify their attributes
3. Identify the degree of their relationship
4. Identify their cardinalities
5. Identify Constraint
1. Entities:
- University Dorm
- Student
- Room
- Floor
- Building

2. Attributes:
- University Dorm: name, address, capacity
- Student: ID, name, gender, contact number
- Room: number, capacity
- Floor: number, capacity
- Building: name, address

3. Degree of Relationship:
- The University Dorm has a relationship with the Student, Room, Floor, and Building entities.
- Student has a relationship with Room.
- Room has a relationship with Floor.
- Floor has a relationship with Building.

4. Cardinalities:
- University Dorm-Student relationship: One University Dorm can have many Students, and each Student can only belong to one University Dorm. (1-to-many)
- University Dorm-Room relationship: One University Dorm can have many Rooms, and each Room can only belong to one University Dorm. (1-to-many)
- Room-Floor relationship: One Room can belong to one Floor, and each Floor can have many Rooms. (1-to-many)
- Floor-Building relationship: One Floor can belong to one Building, and each Building can have many Floors. (1-to-many)

5. Constraints:
- Capacity Constraint: The number of students in a University Dorm cannot exceed its capacity.
- Unique Room Constraint: Each Room in a University Dorm must have a unique number.
- Unique Floor Constraint: Each Floor in a Building must have a unique number.
- Unique Building Constraint: Each Building must have a unique name.