Javatpoint Logo
Javatpoint Logo

Entity in DBMS

Database Management System (DBMS) is an essential tool to manage data, but do you know how important entities are in DBMS?

The role of the entity is the representation and management of data. In this article, we are going to discuss entities in DBMS.

Entity in DBMS

Entity:

An entity is referred to as an object or thing that exists in the real world. For example, customer, car, pen, etc.

Entities are stored in the database, and they should be distinguishable, i.e., they should be easily identifiable from the group. For example, a group of pens that are from the same company cannot be identified, so they are only objects, but pens with different colours become unique and will be called an entity like a red pen, green pen, blue pen, black pen, etc.

In a group of pens, we can easily identify any pen because of its different colours, so a pen of different colours is an entity.

For extracting data from the database, each data must be unique in its own way so that it becomes easier to differentiate between them. Distinct and unique data is known as an entity.

An entity has some attributes which depict the entity's characteristics. For example, an entity "Student" has attributes such as "Student_roll_no", "Student_name", "Student_subject", and "Student_marks".

Example of Entity in DBMS in tabular form:

Student_rollno Student_name Student_subject Student_marks
1 Robert English 85
2 Parker Mathematics 75
3 Harry Science 80
4 George Geography 70

Some entities are related to other entities in the table. For example, the "Student" entity is related to the "University" entity. The ERD (Entity Relationship Diagram) model comes to light to visually show the relationship between several entities.

Kinds of Entity:

There are two kinds of entities, which are as follows:

1. Tangible Entity:

It is an entity in DBMS, which is a physical object that we can touch or see. In simple words, an entity that has a physical existence in the real world is called a tangible entity.

For example, in a database, a table represents a tangible entity because it contains a physical object that we can see and touch in the real world. It includes colleges, bank lockers, mobiles, cars, watches, pens, paintings, etc.

2. Intangible Entity:

It is an entity in DBMS, which is a non-physical object that we cannot see or touch. In simple words, an entity that does not have any physical existence in the real world is known as an intangible entity.

For example, a bank account logically exists, but we cannot see or touch it.

Entity Type:

A collection of entities with general characteristics is known as an entity type.

For example, a database of a corporate company has entity types such as employees, departments, etc. In DBMS, every entity type contains a set of attributes that explain the entity.

The Employee entity type can have attributes such as name, age, address, phone number, and salary.

The Department entity type can have attributes such as name, number, and location in the department.

Kinds of Entity Type

There are two kinds of entity type, which are as follows:

1. Strong Entity Type: It is an entity that has its own existence and is independent.

The entity relationship diagram represents a strong entity type with the help of a single rectangle. Below is the ERD of the strong entity type:

Entity in DBMS

In the above example, the "Customer" is the entity type with attributes such as ID, Name, Gender, and Phone Number. Customer is a strong entity type as it has a unique ID for each customer.

2. Weak Entity Type: It is an entity that does not have its own existence and relies on a strong entity for its existence.

The Entity Relationship Diagram represents the weak entity type using double rectangles. Below is the ERD of the weak entity type:

Entity in DBMS

In the above example, "Address" is a weak entity type with attributes such as House No., City, Location, and State.

The relationship between a strong and a weak entity type is known as an identifying relationship.

Using a double diamond, the Entity-Relationship Diagram represents a relationship between the strong and the weak entity type.

Let us see an example of the relationship between the Strong entity type and weak entity type with the help of ER Diagram:

Entity in DBMS

Entity Set

An entity set is a group of entities of the same entity type.

For example, an entity set of students, an entity set of motorbikes, an entity of smartphones, an entity of customers, etc.

Entity sets can be classified into two types:

1. Strong Entity Set:

In a DBMS, a strong entity set consists of a primary key.

For example, an entity of motorbikes with the attributes, motorbike's registration number, motorbike's name, motorbike's model, and motorbike's colour.

Below is the representation of a strong entity set in tabular form:

Entity in DBMS

Example of Entity Relationship Diagram representation of the above strong entity set:

Entity in DBMS

2. Weak Entity Set:

In a DBMS, a weak entity set does not contain a primary key.

For example, An entity of smartphones with its attributes, phone's name, phone's colour, and phone's RAM.

Below is the representation of a weak entity set in tabular form:

Entity in DBMS

Example of Entity Relationship Diagram representation of the above weak entity set:

Entity in DBMS

Conclusion:

In this article, you read all the vital things related to entities in DBMS.

  • We have discussed that entity is anything that exists in the real world and is identifiable.
  • We have discussed the types of entities, which are tangible entities and intangible entities.
  • We have discussed entity type and types of entity type, which are weak entity type and strong entity type.
  • We have discussed entity sets and types of entity sets, which are weak entity sets and strong entity sets.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA