Categories: DBMS

Basic Concepts of ER Model

The ER (Entity-Relationship) model is a conceptual data model used in database design. It represents the data in terms of entities, attributes, and relationships. Here are the basic concepts of the ER model:

  • Entity: An entity is a real-world object, concept or thing with an independent existence that can be easily distinguished from other objects. In a database, an entity is represented as a table, and each row in the table represents an instance of the entity.
  • Attribute: An attribute is a characteristic or property of an entity that describes it. For example, in an entity called “Customer”, “Name”, “Address”, and “Phone Number” could be attributes. In a database, attributes are represented as columns in a table.

There are many different types of attributes defined in the ER database model, some of which are listed below:

  1. Simple attributes are those that have values that are atomic and cannot be further subdivided. age of the student, for instance.
  2. A composite attribute is one that combines more than one simple attribute. For instance, the address of a student will include the house number, street name, pin code, etc.
  3. Derived attributes are those that aren’t actually part of the overall database management system but are instead created by using other attributes. for instance, the typical age of a class.
  4. Single-valued attribute: They have a single value, as their name would imply.
  5. Multi-valued attribute: And, they can have multiple values.
  • Relationship: A relationship is an association between two or more entities. It represents how the entities are connected to each other. In a database, relationships are represented as links between tables. The number of participating entities in a relationship defines the degree of the relationship.
  1. Binary = degree 2
  2. Ternary = degree 3
  3. n-ary = degree
  • Cardinality: Cardinality refers to the number of occurrences of one entity that can be associated with the number of occurrences of another entity in a relationship. There are three types of cardinalities: one-to-one, one-to-many, and many-to-many.
  • Primary Key: A primary key is a unique identifier for a record in a table. It is used to ensure that each record in the table is uniquely identified and can be easily accessed. In the ER model, a primary key is represented as an attribute of the entity.
  • Foreign Key: A foreign key is a field or combination of fields in a table that refers to the primary key of another table. It is used to establish a relationship between two tables.

The ER model provides a visual representation of the database and helps to ensure data integrity by defining the relationships between entities. It is a widely used model in database design due to its flexibility, scalability, and ease of use.

Note: also read about Data Models – DBMS

Follow Me

Please follow me to read my latest post on programming and technology if you like my post.

https://www.instagram.com/coderz.py/

https://www.facebook.com/coderz.py

Share
Published by
Rabecca Fatima

Recent Posts

Minimum Cost to Paint Houses with K Colors

A builder plans to construct N houses in a row, where each house can be…

1 day ago

Longest Absolute Path in File System Representation

Find the length of the longest absolute path to a file within the abstracted file…

3 weeks ago

Efficient Order Log Storage

You manage an e-commerce website and need to keep track of the last N order…

1 month ago

Select a Random Element from a Stream

You are given a stream of elements that is too large to fit into memory.…

1 month ago

Estimate π Using Monte Carlo Method

The formula for the area of a circle is given by πr². Use the Monte…

2 months ago

Longest Substring with K Distinct Characters

Given an integer k and a string s, write a function to determine the length…

2 months ago