0% found this document useful (0 votes)
2 views4 pages

Practical 2 Er Diagram

The document outlines the purpose and components of an Entity-Relationship (ER) diagram, which is used to visually model a database's entities, attributes, and relationships. Key components include entities (represented by rectangles), attributes (ovals), relationships (diamonds), and the use of primary and foreign keys. An example ER diagram for a College Management System is provided, detailing entities such as Branch, Course, Student, and Professor, along with their attributes and relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

Practical 2 Er Diagram

The document outlines the purpose and components of an Entity-Relationship (ER) diagram, which is used to visually model a database's entities, attributes, and relationships. Key components include entities (represented by rectangles), attributes (ovals), relationships (diamonds), and the use of primary and foreign keys. An example ER diagram for a College Management System is provided, detailing entities such as Branch, Course, Student, and Professor, along with their attributes and relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PRACTICAL -2

TITLE: ER Diagram

OBJECTIVE: to visually model a databases entities, attributes, and


relationships.

An Entity-Relationship (ER) diagram is a visual representation used to model the


data structure of a database. It illustrates the relationships between different
entities in the database and helps in designing and organizing the data effectively.
ER diagrams are composed of the following key components:

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."

2. Attributes: These are the properties or details of an entity. They are


represented by ovals connected to their respective entities. For a "Student" entity,
attributes could include "Student ID," "Name," and "Email."

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.

Types of Shapes Used in ER Diagrams:


• Rectangle: Represents entities.
• Oval: Represents attributes.
• Diamond: Represents relationships.
• Line: Links attributes to entities and entities to relationships.
• Double Oval: Represents derived attributes.
• Double Rectangle: Represents a weak entity.
• Dashed Line: Represents a relationship that is optional.

Example ER Diagram: College Management System

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

You might also like