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

Generate Parenthesis | Intuition + Code | Recursion Tree | Backtracking | Java

Problem Statement: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example…

3 months ago

Square Root of Integer

Given an integer A. Compute and return the square root of A. If A is…

1 year ago

Build Array From Permutation

Given a zero-based permutation nums (0-indexed), build an array ans of the same length where…

1 year ago

DSA: Heap

A heap is a specialized tree-based data structure that satisfies the heap property. It is…

2 years ago

DSA: Trie

What is a Trie in DSA? A trie, often known as a prefix tree, is…

2 years ago

Trees: Lowest Common Ancestor

What is the Lowest Common Ancestor? In a tree, the lowest common ancestor (LCA) of…

2 years ago