The Institute of Finance Management
Faculty of Computing and
Mathematics
TUTORIAL 4
Converting the following E-R Diagrams into Relational
Tables
1. ER Diagram 1
2. ER Diagram 2
To convert E-R diagrams into relational tables, you'll
need to follow a systematic approach. Here's a general
guide on how to do that:
### General Steps for Conversion
1. **Identify Entities:** Each entity becomes a table.
2. **Identify Attributes:** Each attribute of an entity
becomes a column in the corresponding table.
3. **Identify Primary Keys:** Each table must have a
primary key, typically the unique identifier of the entity.
4. **Identify Relationships:** Relationships between
entities will often require foreign keys in the tables.
### Example Conversions
Since you haven't provided specific E-R diagrams, I'll
demonstrate the conversion process with hypothetical
examples.
#### Example 1: ER Diagram 1
**Entities:**
- **Student**
- Attributes: StudentID (PK), Name, Age, Major
- **Course**
- Attributes: CourseID (PK), CourseName, Credits
**Relationships:**
- **Enrollment** (between Student and Course)
- Attributes: EnrollmentID (PK), StudentID (FK),
CourseID (FK), EnrollmentDate
**Relational Tables:**
1. **Student Table**
- StudentID (Primary Key)
- Name
- Age
- Major
2. **Course Table**
- CourseID (Primary Key)
- CourseName
- Credits
3. **Enrollment Table**
- EnrollmentID (Primary Key)
- StudentID (Foreign Key referencing Student)
- CourseID (Foreign Key referencing Course)
- EnrollmentDate
---
#### Example 2: ER Diagram 2
**Entities:**
- **Instructor**
- Attributes: InstructorID (PK), Name, Department
- **Department**
- Attributes: DepartmentID (PK), DepartmentName
**Relationships:**
- **Teaches** (between Instructor and Department)
- Attributes: TeachesID (PK), InstructorID (FK),
DepartmentID (FK)
**Relational Tables:**
1. **Instructor Table**
- InstructorID (Primary Key)
- Name
- Department
2. **Department Table**
- DepartmentID (Primary Key)
- DepartmentName
3. **Teaches Table**
- TeachesID (Primary Key)
- InstructorID (Foreign Key referencing Instructor)
- DepartmentID (Foreign Key referencing Department)
---
### Conclusion
This is a generic method to convert E-R diagrams into
relational tables. If you have specific diagrams you
want to convert, feel free to provide descriptions or
details, and I can help you create the corresponding
relational tables!