Practical 2 Er Diagram
Practical 2 Er Diagram
TITLE: ER Diagram
1. Entities: These are objects or concepts that can have data stored about them.
They are usually represented by rectangles. For instance, in a college database,
entities could be "Student," "Course," "Professor," and "Department."
3. Relationships: These depict how entities are related to each other. They are
usually represented by diamonds. For example, a "Student" entity might have a
relationship with a "Course" entity through an "Enrols" relationship.
4. Primary Key: This is a special attribute that uniquely identifies each instance
of an entity. It is typically underlined in the diagram.
5. Foreign Key: An attribute that creates a link between two entities. It is used to
establish a relationship between entities.
I'll describe an ER diagram where all the branches of a college are defined.
1. Entities:
• Branch: Represents different branches in the college.
• Attributes: Branch ID (Primary Key), Branch Name, Location.
• Course: Represents courses offered by each branch.
• Attributes: Course ID (Primary Key), Course Name, Credits.
• Student: Represents students enrolled in various branches.
• Attributes: Student ID (Primary Key), Name, Enrolment Year.
• Professor: Represents professors teaching in branches.
• Attributes: Professor ID (Primary Key), Name, Department.
2. Relationships:
Offers: Connects the "Branch" entity with the "Course" entity to show which
courses are offered by each branch.
Enrolled In: Connects the "Student" entity with the "Branch" entity to show
which branch a student is enrolled in.
Teaches: Connects the "Professor" entity with the "Course" entity to show
which courses a professor teaches.
ER Diagram