Entity types

Comprehensive study notes, diagrams, and exam preparation for Entity types.

Entity Types

Definition

An entity type is a category or class of similar real-world objects, persons, places, events, or things that have the same attributes and can be uniquely identified in a database or data model.

For example:

Student

  • is an entity type

Employee

  • is an entity type

Product

  • is an entity type

Each entity type contains multiple individual entities.
For example, if Student is the entity type, then “Amit,” “Sara,” and “John” are individual entities of that type.


Main Content

1. First Concept: Entity and Entity Type

  • An entity is a single real-world object or item, while an entity type is the general category to which that object belongs.
  • Example: In a school system, “Rahul” is an entity, and “Student” is the entity type.

An entity type acts like a blueprint. It defines what information will be stored about all objects in that category. For instance, the entity type Student may include attributes such as:

  • Student_ID
  • Name
  • Age
  • Class
  • Address

All students in the system will have these common attributes, though the values may differ from one student to another.

Example table:

Student_ID Name Age Class
S101 Asha 18 12-A
S102 Rohit 17 11-B

Here, Student is the entity type, and each row represents an entity instance.


2. Second Concept: Types of Entity Types

Entity types are commonly classified based on how they exist and how they are identified in a model.

Strong Entity Type

  • A strong entity type can exist independently.
  • It has its own primary key or unique identifier.
  • Example: Employee, Customer, Product
  • These entities do not depend on another entity type for their existence.

Weak Entity Type

  • A weak entity type cannot be uniquely identified by its own attributes alone.
  • It depends on a strong entity type for identification.
  • Example: Dependent of an employee, or Order_Item within an order
  • A weak entity usually has a partial key and needs a relationship with a strong entity to be identified.

Simple relationship illustration:

Employee ---- has ---- Dependent
   |
 strong               weak
 entity               entity

In this example, a dependent may not be unique without knowing which employee it belongs to.

Another important classification is:

Regular Entity Type

  • Same as strong entity type in most cases.
  • Example: Book, Teacher

Associative Entity Type

  • Used to represent a relationship between two entity types as an entity.
  • Example: Enrollment between Student and Course
  • It is useful when a many-to-many relationship needs extra details such as date, grade, or status.

Example:

  • A student can enroll in many courses.
  • A course can have many students.
  • The enrollment itself becomes an associative entity with attributes like:
  • Enrollment_ID
  • Enrollment_Date
  • Grade

3. Third Concept: Attributes and Identification of Entity Types

Every entity type is described using attributes, which are the properties or characteristics of that entity type.

For example:

  • Entity Type: Car
  • Attributes: Car_ID, Model, Brand, Color, Year

Attributes help define what information is stored and how each entity instance is distinguished from others.

Entity types are identified by keys:

Primary Key

  • : Uniquely identifies each entity instance

Candidate Key

  • : A possible unique identifier

Partial Key

  • : Used in weak entities to distinguish entities under the same strong entity

Example:

Car_ID Model Brand Color
C001 Civic Honda White
C002 Corolla Toyota Black

Here, Car_ID is the key attribute that identifies each car uniquely.

Entity types also follow the principle of homogeneity:

  • All instances in an entity type share the same kind of attributes.
  • This makes the data consistent and easier to manage.

For example:

  • Every Student has a name and student ID
  • Every Product has a product code and price
  • Every Employee has an employee ID and department

Working / Process

1. Identify real-world objects

  • Determine what objects, people, places, or events need to be stored in the system.
  • Example: In a library system, identify Book, Member, and Loan.

2. Group similar objects into entity types

  • Combine objects that share the same properties into one category.
  • Example: All books belong to the entity type Book, all users borrowing books belong to Member.

3. Define attributes and keys

  • Decide what details are needed for each entity type.
  • Choose a unique identifier such as Book_ID or Member_ID.
  • If necessary, determine relationships with other entity types.
  • Example: Loan may connect Member and Book with loan date and return date.

Advantages / Applications

  • Helps organize data in a structured and logical way
  • Makes database design easier by clearly defining categories of information
  • Improves data consistency, uniqueness, and retrieval efficiency
  • Widely used in database systems, ER modeling, software design, and business information systems
  • Useful in applications such as:
  • School management systems
  • Hospital management systems
  • Banking systems
  • E-commerce platforms
  • Library management systems

Summary

  • Entity types are categories of similar real-world objects stored in a database.
  • They are described by common attributes and identified by keys.
  • Strong, weak, and associative entity types are the main forms used in data modeling.
  • Important terms to remember: entity, entity type, attribute, key, strong entity, weak entity, associative entity