Database management systems play an important role in managing the data. But how is this data stored in the database management system? It uses entities for representing and managing the data. What is an entity? In this blog, Let us understand what an entity is, how important the entities are and the types of entities in the digital marketing system.
A real-world object or thing is referred to as an entity that is generally organized into tables that enables more efficient storage and data retrieval. They have a unique identity and can be manipulated as a single unit. Generally, an entity is composed of multiple attributes.
Examples of an entity: car, apple, computer, dog, etc
An attribute provides information about the characteristic features of the entity. If a customer is an entity, first name, last name, address of that customer are the attributes of that entity.
There are different types of entities in database management. They are tangible and intangible entities.
Tangible entity: It is a physical object which we can see, touch/measure. Some of the examples for tangible entities include cars, people and buildings. Another example of tangible entity is a table in a database. It is an object that can be viewed and interacted with.
Intangible entity: It is a non physical object in the database management that we cannot see, touch/measure. Users' information like their login id and password will be considered as the intangible entity. Because, this data cannot be viewed or interacted with. Examples of intangible entities will also include emotions, thoughts and memories.
Now let us understand why entities are crucial in the database design.
An entity relationship model is a conceptual modeling technique that is popularly used in database design. It offers a graphical representation of the entities, attributes of the entities and the relationship between them.
An entity type is a set of entities that have similar attributes. If we consider an entity students, it will have common attributes like Student name, roll number, mobile number. Entities are classified into different types in the context of ER model, as per their characteristics and dependencies.
Strong entities: Strong entities are those that have a primary key, a unique identifier that is used only by them. Each instance of the entity is identified uniquely by the primary key, which might be one attribute or a blend of attributes. The "Customer ID," for instance, could serve as the primary key for a "Customer" entity. Strong entities can exist without the help of other entities.
Weak entities: Weak entities are those that are dependent on another entity for their existence. They are dependent on a strong entity known as the identifying or owner entity rather than possessing their own primary key. The primary key of the weak entity comprises its own properties as well as a foreign key referring to the owner entity. An "Employee" entity serving as the owner of a "Dependent" entity, for instance, might make it weak.
Associative entities: Relationships between other entities are represented as associative entities, also called intersection entities or relationship entities. They are created to address many to many relationships between entities. An associative entity records further details regarding the relationship itself.
Imagine, we have entities for "Student" and "Course." A student may enroll for more than one course, and a course may have more than one student. We can introduce an associative entity called "Enrollment" with the attributes like "Date" and "Grade" to express this relationship. Our ability to record particular information about each student's enrollment in a course is made possible by the "Enrollment" entity, which connects the "Student" and "Course" entities.
In the ER diagram, associative entities are shown as rectangles with the name of the relationship written inside. They share relationships with the involved entities. The associative entity's attributes are shown as ovals attached to the entity rectangle.
The associations and the interactions between entities in a database are defined by relationships. They show the relationships between different entities. Following are the different types of relationships:
1. One-to-One (1:1): One instance of one entity is linked to just one instance of another, and vice versa, in a one-to-one relationship (1:1). For instance, a "Person" entity and a "Passport" entity can have a one-to-one relationship where any person only has one passport and each passport is only associated with one person.
2. One-to-Many (1:N): In this type of relationship, one instance of one entity is associated with several instances of another, but every instance of the other entity is associated with a single instance of the first.
Consider two entities namely “department” and “employee”. Department entity will have one to many relationships with the employee entity. Although there may be several employees in each department, each employee belongs to only one department.
3. Many-to-Many (N:N): Multiple instances of one entity are associated with multiple instances of another entity in a many-to-many relationship. An associative entity is often used to implement this relationship. If we consider a student entity and a course entity, they have a many-to-many relationship in which multiple students can be found in each course and several students can register in different courses.
Now let us go through how the names of the entities and attributes must be given.
Entity naming conventions are rules for naming entities and their attributes in a database to provide clarity, consistency, and maintainability. Following are some of the best practises:
To make the database easier to understand and manage, use consistent naming standards throughout. Maintain consistency in the naming of entities, attributes, and relationships.
Conclusion:
In this blog, we have seen what is an entity, Types of Entities, Importance of entities in the database design, What is Entity type? Entity Relationships and Entity Naming Conventions. We hope you found this blog informative. For more such blogs stay tuned to HKR Trainings.
Related Articles
Batch starts on 29th Sep 2023, Fast Track batch
Batch starts on 3rd Oct 2023, Weekday batch
Batch starts on 7th Oct 2023, Weekend batch
.