entity relationship diagrams

 A database's entities and the connections that connect them are graphically represented in an entity-relationship diagram (ERD). ERDs are used to create and visualise a database's structure and to make sure it is effectively normalised. We shall define the main words associated with ERDs in this blog article, including entities, attributes, cardinalities, and relationships.


Entities


In the actual world, entities are things or ideas that stand out from other things due to particular qualities they possess. A rectangle serves as the representation of an entity in an ERD, and the entity name is written inside the rectangle. The entity's customers, items, and orders are examples of this.


Cardinalities


Cardinalities define the relationships between entities in a database and describe how many instances of an entity can be associated with another entity. The minimal and maximal number of relationships between things are shown as symbols for cardinalities in an ERD. There are four categories of cardinality:


  • One-to-One (1:1): This cardinality shows that there is only one instance of one entity that is connected to another entity.

  • One-to-Many (1:N): According to this cardinality, an entity can have many instances of other entities that are connected to it, but each instance of an entity that is related to another entity can only have a single instance of the first entity.

  • The cardinality known as many-to-one (N:1) states that while there may be many instances of one entity that are connected to a single instance of another, there may only be one relationship between each instance of the first entity and each instance of the related entity.

  • A relationship between many instances of one thing and many instances of another is known as a many-to-many (N:N) cardinality.

Relationships


  • The links between entities in a database are known as relationships. Relationships are shown in an ERD by connecting the entities with lines that also contain the cardinality symbols that characterise the relationship. Three categories of relationships can be made:

  • One instance of one entity is associated with just one instance of another entity in a one-to-one connection.

  • One-to-Many: This kind of relationship arises when there are numerous instances of one entity that are connected to only one instance of another.

  • Many instances of one entity may be linked to several instances of a different entity in a many-to-many connection.

Comments