Entity Relation Model Flashcards
History of ER
→ proposed by Peter Chen in 1976
→ used to visually represent the structure of a database, making it easier for designers to understand and communicate the requirements of a system
ER diagram
→ Is a Visual representation of a database’s structure.
→ Represents tables (entities) and their relationships.
→ Utilizes symbols for entities, attributes (columns), and relationships.
→ Keys, including primary and foreign keys, connect tables.
→ Each column is represented by a key.
→ Symbols ensure consistency and uniqueness for each table.
→ Facilitates team collaboration by providing a visual blueprint.
→ Shareable documents that enhance teamwork and understanding.
Advantages of ER Diagram
→ Clarity and Simplicity
→ Shareability
→ Ease of Modification
→ Expandability
→ Comprehensive Overview
Components of ER Diagram
→ Entities
→ Attributes
→ Relationships
Entities
→ An entity is a real-world object, concept, or thing that is distinguishable and identifiable. It can be presented with specific attributes.
→ Entity Set: An entity set is a collection or grouping of similar entities. The entity set is the set of all entities that share the same set of attributes. (the entire table)
→ Strong Entity: is a type of entity that has a key Attribute. Strong Entity does not depend on other Entity in the Schema. It has a primary key, that helps in identifying it uniquely. (has a primary key)
→ Weak Entity: is a type of entity that does not have a primary key that uniquely identifies it on its own. It relies on another entity, known as the owner or parent entity, for identification. (no primary key)
Strong Entity Set vs Weak Entity Set
→ Strong Entity Set
Has a primary key
Relations can be created between entities
Normalization (ability to create small tables)
Hierarchy data set
Partitional relations (Relationships can be established independently without relying on other entities.)
Independent
→ Weak Entity Set
No primary key
Weak relations
Represented in bigger tables
Non-hierarchical
Optional relations
Dependent
Attributes
are the properties that define the entity type.
Cardinality/Relationships
→ Optional Relationships:
* Optional: Entities in the relationship may or may not participate.
* Mandatory: Entities in the relationship must participate.
→ Partitional Relationships:
* One-to-One: Each entity in the relationship is related to only one other entity.
* One-to-Many: An entity in one set is related to multiple entities in another set.
* Many-to-Many: Entities in both sets can be related to multiple entities in the other set.
→ If a many-to-many relation is created, it’d create a weak entity set: Many-to-many relationships often require the introduction of a junction or associative entity, which can be considered a form of a weak entity set.
ER Notations
→ Strong Entity: rectangle
→ Weak Entity: double rectangle
→ Attribute: oval
→ Relationship: diamond
→ Weak Relationship: double diamond
→ Mandatory: small line
→ Optional: small circle
→ One: small line
→ Many: 3 lines
Steps to Create an ERD
- Entity Identification
- Relationship Identification
- Cardinality Identification
- Identify Attributes
- Create ERD
Creating Effective ER Diagrams
→ Create strong entity sets
→ Use easy-to-read naming and symbols
→ Clear symbols
→ Don’t connect tables with same keys
→ Synchronization