Entity, Attribute, Relation

617 단어·3 분·원문(.md)

ERD Creation Steps #

  1. Draw entities.
  2. Arrange entities appropriately.
  3. Establish relationships between entities.
  4. Describe relationship names.
  5. Describe relationship cardinality.
  6. Describe relationship optionality.

Entity #

Characteristics of an Entity

  • It must be information necessary for the business and intended for management.
  • It must be identifiable by a unique identifier.
  • It must be a collection of persistently existing instances (two or more).
  • An entity must have attributes.
  • An entity must have at least one relationship with another entity.

Types of Entities #

Basic Entity (Key Entity) Information that originally exists in the business, not created by relationships with other entities, and can be created independently.

It acts as a parent to other entities. However, it does not inherit primary identifiers from other entities but possesses its own unique primary identifier.

For example, employee, department, customer, product, and material can be basic entities.

Central Entity (Main Entity) Arises from basic entities and plays a central role in the business.

Generates a large volume of data and creates many entities through relationships with other entities.

For example, contract, incident, deposit ledger, claim, order, and sales can be central entities.

Behavior Entity Arises from two or more parent entities, and its content frequently changes or data volume increases.

It does not appear often in the early analysis phase and can be derived during the detailed design phase or through process and correlation modeling.

Examples include order lists and employee change history.

Relationship between Entity, Instance, Attribute, and Attribute Value #

  • A single entity must be a collection of two or more instances.
  • A single entity has two or more attributes.
  • A single attribute has one attribute value.

ERD Drawing Tip

  • For readability, place the most important entity slightly below the top-left corner to effectively arrange relationship lines without tangling.

Attribute #

Each attribute has a possible range, which is called the attribute's domain. This involves specifying the data type, size, and constraints for attributes within an entity.

Classification by Attribute Characteristics #

Basic Attribute #

All attributes extracted from the business fall into this category, representing the most common and numerous attributes in an entity.

All attributes are basic attributes, except for code-like data, serial numbers assigned to identify entities (designed attributes), and attributes generated by calculating or being influenced by other attributes (derived attributes).

Designed Attribute #

Attributes defined by creating or modifying them for data modeling and to regularize business operations, in addition to data necessary for business.

Derived Attribute #

Attributes created to store calculated values of original attributes to enable fast performance when querying data.

Attribute Naming #

  • Assign names used in the relevant business.
  • Do not use descriptive attribute names.
  • Restrict the use of abbreviations as much as possible.
  • It is good to ensure uniqueness across the entire data model.

Relation #

In ERDs, existential relationships and behavioral relationships are not distinguished, but in class diagrams, they are differentiated and expressed as association and dependency relationships.

In UML (Unified Modeling Language), among the relationships in class diagrams, there are Association and Dependency, which are represented differently using solid and dashed line notations.

Relationship Notation #

  • Relationship Name (Membership): The name of the relationship
  • Cardinality: 1:1, 1:M, M:N
  • Optionality: Mandatory relationship, Optional relationship

Reading Relationships #

  • Read the source entity as one or each.
  • Read the target entity's participation, i.e., the count (one, one or more).
  • Read the optionality and relationship name.

Checkpoints when deriving relationships between two entities

  • Does an association rule of interest exist between the two entities?
  • Does a combination of information occur between the two entities?
  • Are rules for relationship connections described in the business specification or forms?
  • Are there verbs in the business specification or forms that enable relationship connections?
DataBase/ear.md