Entity in DBMS: Types with Examples

Updated on July 19, 2024

Article Outline

To understand Database management systems foundationally, you should know what is an entity in DBMS. Entity is a fundamental and key concept to understanding database design. An entity in DBMS is any object that can be distinguished from other objects in the real world. It is a unique object that can be identified within database systems. In this blog, we will understand the meaning of an entity in DBMS, its different types, examples, and much more.

What is an Entity in DBMS?

An entity is a significant “thing” or “object”, idea, or tangible or intangible element, that can be identified uniquely and stored in a database. Entities in databases are easily identified like a student, employee, car, bank, bike, etc. Entities play the role of data storage and are used for organising and managing the data in a database. Attributes or characteristics are the one that describes and defines an entity uniquely.

 

For example, A car is an entity that has attributes like a model, colour, year, etc., and A bank is an entity that has attributes like branch name, IFSC code, etc. A Student is an entity that has attributes like a name, roll no, major, etc., An employee is an entity that has attributes like an emp_name, emp_id, emp_dept, etc. So, these are some common and real-life entities examples through which you can easily understand the concept of entities in DBMS.

primary key

Types of Relationships in DBMS

Relationships are an important part of the entities as significant for the structuring and the easy retrieval of data. Relationships are often related to each other and use different kinds of keys to create a relation between them In DBMS, typically there are 3 types of relationships. They include:

 

  1. One-to-One (1:1)- A one-to-one is a relationship in which the cardinality between two entities is one-to-one only. Here, it means that each instance of one entity is related to one and only one instance of another entity.
  2. One-to-many (1:M)- A one-to-many is a relationship in which the cardinality between two entities is one-to-many. It means that each instance of one entity is related to many instances of another entity.
  3. Many-to-many (M:M)- A many-to-many is a relationship in which the cardinality between two entities is many-to-many. It means that multiple instances of one entity are related to multiple instances of another entity.

Attributes of Entities in DBMS

Attributes are the important characteristics of entities that help those instances provide the important details of themselves. There are various types of attributes of an entity that include:

 

  • Simple attribute: A simple attribute is an attribute that can’t be divided or derived further. It is also known as atomic attributes. For example, the Age of a student can’t be divided further.
  • Single-valued attribute: A single-valued attribute is an attribute that holds or contains only and only one value. For example, the date of birth is only single.
  • Multi-valued attribute: A multi-valued attribute is an attribute that contains more than the same type of value. For example, email and phone numbers can be multiple.
  • Composite attribute: A composite attribute is an attribute that is made using two or more attributes and are combined into one. This attribute can also be further divided into two or more derived attributes. For example, the Address attribute can be made using attributes like city, state, street, pincode, etc.
  • Derived attribute: A derived attribute is an attribute that can be divided or derived further. For example, the Age of a student can be derived from the date of birth attribute.

 

Till now, we have understood the basics of Entities in DBMS including the types of relationships and attributes. Let’s now understand the types of Entities in DBMS.

*Image
Get curriculum highlights, career paths, industry insights and accelerate your technology journey.
Download brochure

Types of Entities in DBMS?

Entities in DBMS are of different types which are distinguished based on their characteristics and the context in which they are used. We will see the common and most used types of entities in DBMS. The types of entities in DBMS include:

1. Strong Entity

A Strong Entity is a type of entity in DBMS that has a key attribute and a unique identifier. A strong entity is also known as an independent entity in DBMS. This entity is capable of existing in a database relation without any other entity. A strong entity is also a primary key or a key attribute that helps this entity to identify each instance of the entity uniquely. These entities exist in real words and are represented as objects.

 

Let’s see some real-world examples to understand the strong entity:

 

Examples:

 

  1. Student (entity): In a university database, suppose there is an entity called Student which consists of different attributes including student_name, student_id, student_course, student_dept, etc. Now, to uniquely identify a student can be done using the primary key which is “student_id” in this example.
  2. Employee (entity): In an employee database, suppose there is an entity called Employee which consists of different attributes including e_name, e_id, e_phn, e_dept, etc. Now, to uniquely identify an employee, it can be done using the primary key which is “e_id” in this example.
  3. Customer (entity): In a customer-relation database, suppose there is an entity called Customer which consists of different attributes including customer_name, customer_email, customer_purchase_id, customer_address, etc. Now, to uniquely identify a customer can be done using the primary key which is “customer_purchase_id” in this example.

strong entity

2. Weak Entity

A weak entity is a type of entity in DBMS that cannot exist in the database without a strong entity. As a strong entity consists of a primary key (a unique identifier), the weak entity has no primary key. A weak entity is also known as a dependent entity in DBMS. To ensure its uniqueness, it takes the help of the strong entity and relies on a concept called foreign key relationship. This entity also represents a part or a component of the strong entity in the database.

 

Let’s see some real-world examples to understand the weak entity:

 

Examples:

 

  1. Course_Enrollment (entity): In a university database, suppose there is a weak entity called Course_Enrollment which consists of different attributes including course_enroll_name, course_enroll_id, course_enroll_dept, course_enroll_status, etc. Here, the course_enroll_id is dependent on the student_id and the course_id which are both other strong entities in a database.
  2. Order (entity): In a customer_order database, suppose there is an entity called Order which consists of different attributes including order_id, order_name, product_id, order_qty, etc. Here, the order_id is dependent on the customer_id which is the part of a strong entity “Customer” in a database.
  3. Email (entity): In an employee database, suppose there is an entity called Email which consists of different attributes including email_id, email_date, email_sender, email_receiver, etc. Here, the email_id is dependent on the person_id which is the part of a strong entity “Person” in a database.

weak entity

3. Composite Entity

A composite entity in DBMS is a type of associative entity or junction table that represents the many-to-many relationships between the two different strong entities in a database. As the name’s meaning implies, it is composed of two or more strong entities that include the foreign keys from different related entities of the database.

 

Let’s see some real-world examples to understand the composite entity:

 

Examples:

 

  1. Course_Enrollment (entity): In a university database, suppose there is an entity called Course_Enrollment which consists of different attributes including course_enroll_name, course_enroll_id, course_enroll_dept, course_enroll_status, etc. Here, the Course_Enrollment entity may represent many-to-many relationships with other entities like Student and Course. Here the composite keys might include the attributes of these entities that represent the relation with the foreign keys including student_id and course_id.

Classification of Entity types in DBMS?

Entity types are classified further as two different types according to their nature and physical existence. It includes:

 

1. Tangible Entity

A tangible entity is an entity that exists in the physical world and can be touched. Examples of tangible entities include cars, bikes, employees, etc., as they exist physically and can be touched too.

 

2. Intangible Entity

An intangible entity is an entity that does not exist in the physical world and can’t be touched. It is the opposite of tangible entities. Examples of intangible entities include bank transactions, orders, etc., as they do not exist physically and can’t be touched too but are essential for various purposes.

What is an Entity Type DBMS?

Entity type is a combination of related entities that have common characteristics and features. They are used commonly in entity-relationship (ER) diagrams with the symbol of the rectangle. For example, in a movie database, there may be entity types including movie_genre, movie_platform_released, etc. These similar entity types share common attributes and characteristics. Entity types are of different types and include:

 

  • Strong entity type- This entity type exists in the database independently and consists of a unique identifier known as a primary key. It may also include the NULL values as they are allowed in the strong entity type.
  • Weak entity type- This entity type exists in the database dependently and consists of a unique identifier known as a foreign key but it can’t be called a complete unique identifier.
  • Derived entity type- These entity types are derived from another entity through a method of derivation.
  • Multi-valued entity type- These entity types include multiple values for a characteristic.

Entity Type DBMS

What is an Entity Set in DBMS?

An entity set in DBMS is a collection of similar types of entities in a database. Set means a group of all the same entities that belong to the same entity type. Here, each entity within a set is called an instance in the database.

 

For example, all employees belong to the employee database. Another example could be an entity set Course that consists of all the course details where each course data represents the instance of the Course entity set.

Types of Entity Set in DBMS?

There are different types of entity sets in DBMS and they are classified based on the entity’s characteristics and relationships between more than one entity. Entity sets in DBMS include:

 

  • Strong Entity Set- A strong entity set is one that exists in the database independently and with a primary key. It is a standalone set that doesn’t depend on any other entity set.

For example, in a college database, the entity set called “Course” is a strong entity set as individual courses can be identified uniquely using the course_id, or course_code_id, or with a combination of different entities.

 

  • Weak Entity Set- A weak entity set is one that exists in the database with the dependence of another entity and without a primary key but with a foreign key that helps it identify uniquely (like a parent entity).

For example, in a college database, the entity set called “Student_Enroll” is a weak entity set as it can’t be identified uniquely without the dependence of the course_id and student_id.

 

  • Associative Set- An associative entity set represents some relation between more than one entity set. This also consists of a primary key but not as an individual but rather as the primary key of related entities.

For example, an entity set called “Project_Work” was created to define the relation between two other entity sets called “Student” and “Mentor”. This entity set “Project_Work” may consist of attributes like project_start and project_end dates and identify itself using a combination of primary keys of both Student and Mentor entity sets.

 

  • Recursive Set- It is an entity set that represents the relation with itself like a recursion. We call this set a self-referencing entity set as an instance of one entity set may be related to another instance of the same entity set.

Difference Between an Entity and Entity Set in DBMS 

Parameters Entity Entity Set
Define An entity is an object or an idea in a database. An entity set is a collection of the same kind of entities.
Existence An entity represents one instance in a database. An entity set represents the multiple or a group of instances in a database.
Row representation It is any specific record within a table of a database. They are all records within a table of a database.
Attributes Attributes of an entity may include name, address, phone, etc. Attributes of an entity set called a Product may include attributes like P_name, P_id, etc.
Example A customer is an entity. A “customer” set which consists of all consumer details.
Identification An entity can be identified using its primary key which is available in the relation. An entity set can be identified using its primary key which is available in the entity set of a relation.
Usage An entity is mostly used to store a single instance of information in the relation. An entity set is mostly used to store and manage a collection of instances of information in the relation.
Purpose To represent the single instance of a real-world object. To represent, organise, and manage the collection of instances of an entity set in a relation.

Conclusion

In this blog, we delved deep into what is an entity in DBMS. Entities in DBMS represent the real-world object that consists of different attributes to identify them with others. We learned what is an entity, what are its types, its attributes, and many other elements. Having an understanding of the different types of entities, database engineers can create well-structured and optimised databases. Applying the discussed relationships and considering the types of entities while creating a database, can lead to data integrity, efficient data retrieval, etc.

 

FAQs
To identify if an entity is a strong entity or not, we have always a few options. First, check if it consists of a primary key or not. Primary keys can be identified easily like a customer_id, student_id, emp_id, pan_no, ssn, etc, as it will uniquely identify each instance of the entity. Secondly, you can check if it is dependent on another entity or not as the strong entity always exists independently of other entities.
An Entity-Relationship (ER) diagram is a model in DBMS that can help you visualise the structure and entity relationships of a database. An ER diagram can help you identify the different entities, their attributes, and the relationships between one or more entities. ER diagram is used by almost every organisation that uses the databases in its operations.
Yes, it's possible to have a relationship of an entity set with itself. This type of relationship is known as the Recursive entity set in which an instance of one entity set may be related to another instance of the same entity set.
Yes, an entity set may consist of derived attributes as these attributes do not store any data of their own but rather show a derived representation of data based on other entity sets.
A weak entity is one that cannot exist independently and always relies on a strong entity for identification whereas, a strong entity exists independently. A weak entity always uses a foreign key relationship with a strong entity to ensure uniqueness, whereas a strong entity can identify itself using its primary key.

Updated on July 19, 2024

Link
left dot patternright dot pattern

Programs tailored for your success

Popular

IIT Courses

Management

Data Science

Finance

Technology

Future Tech

Upskill with expert articles

View all
Hero Vired logo
Hero Vired is a leading LearnTech company dedicated to offering cutting-edge programs in collaboration with top-tier global institutions. As part of the esteemed Hero Group, we are committed to revolutionizing the skill development landscape in India. Our programs, delivered by industry experts, are designed to empower professionals and students with the skills they need to thrive in today’s competitive job market.
Blogs
Reviews
Events
In the News
About Us
Contact us
Learning Hub
18003093939     ·     hello@herovired.com     ·    Whatsapp
Privacy policy and Terms of use

|

Sitemap

© 2024 Hero Vired. All rights reserved