
MySQL: Entity-Relationship Model
Entity-Relationship model or E R model is used to create a relationship between different attributes or entities. It describes the structure of the database with the help of the ER Diagram or Entity Relationship Diagram. ER model creates a simple design view of the data that makes the data easier to understand. Example: Here, we have a database COMPANY, and in this database, EMPLOYEE is the entity (table). The employee entity contains several attributes like EMP_ID, EMP_NAME, EMP_ADDRESS, EMP_DATE_OF_BIRTH, EMP_AGE, and EMP_CONTACT. ER Model Components 1. Entity The entity in DBMS can be a real-world object having conceptual reality and existence. Example: In a COMPANY database, the entity type is EMPLOYEE. Here employees are real-world persons that have some existence. Entity Types Strong Entity Entities that don’t depend on other entities. Contains a primary key. Represented by a single rectangular box. Example: EMPLOYEE with EMP_ID as primary key. Weak Entity