Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Examples of E-R model
The ER (Entity-Relationship) model represents real-life scenarios as entities. The properties of these entities are their attributes, and their connections are shown as relationships. ER models help visualize how data is structured in a database system.
Hospital ER Model
This ER model has three entities − Patient, Doctor, and Tests ?
Entities and their attributes −
- Patient − ID (primary key), Name, Age, Visit_date
- Tests − Name (primary key), Date, Result
- Doctor − ID (primary key), Name, Specialization
Patients consult Doctors, Patients take Tests, and Doctors conduct Tests.
Company ER Model
This ER model has three entities − Employee, Department, and Project ?
Entities and their attributes −
- Employee − ENO (primary key), Name, Salary
- Department − DNO (primary key), Name, Locations
- Project − PNO (primary key), Name
Employees work for Departments, Departments control Projects, and Employees work on Projects.
Conclusion
These ER model examples demonstrate how complex real-world scenarios can be simplified into entities (rectangles), attributes (properties), and relationships (diamonds). The Hospital model shows patient-doctor-test interactions, while the Company model captures employee-department-project associations.
