Attributes-Entities   «Prev  Next»

Lesson 5Instances of Entities
ObjectiveDescribe instances of entities.

Describe Instances of Entities

In data modeling, an entity is a type (e.g., Customer, Order), while an instance is a single occurrence of that type (one specific customer or order). In a relational database, entity instances are stored as rows in a table; their characteristics are stored as columns (attributes). Each instance is uniquely identified by a key (the entity’s identifier).

What Is an Instance?

An instance of an entity is the group of attribute values that identifies and describes one real-world occurrence of that entity.

  • If your database has 10,000 employees, it contains 10,000 instances (rows) of the Employee entity.
  • Every instance includes a unique identifier (primary key) so it can be referenced unambiguously.

Database Systems

Instances vs. the ER Diagram

An ER diagram shows entity types, their attributes, and relationships—not individual instances. Instances appear when the model is implemented and data is inserted into tables.

employee-entities1
  1. Each card represents a distinct instance (row) of the Employee entity; red ID chips are unique.
  2. Instances of the Employee entity. Example: 15502 is the unique identifier; associated attributes might include Name, Street, and City.

How Instances Are Used

  • Retrieval: Queries select rows (instances) that meet criteria—e.g., all orders for a given CustomerID.
  • Integrity: Keys and constraints ensure each instance is valid and remains linked correctly (no duplicates, no orphan rows).
  • Lifespan: Instances are created, updated, and (sometimes) deleted according to business rules; history/auditing may retain prior versions.

Common Pitfalls

  • No unique key: Without a stable identifier, different people named “John Smith” are indistinguishable.
  • Volatile identifiers: Using changeable data (e.g., phone numbers) as the key causes breakage when values change.
  • Packed attributes: Storing lists in one column (e.g., multiple phones) hides distinct instances that should be modeled as related rows.

Summary

An entity defines what you store; an instance is the actual stored row with its attribute values. Clear identifiers and sound constraints ensure each instance is unique, retrievable, and consistently related to other data.

SEMrush Software Target 5SEMrush Software Banner 5