UO

Week 4 notes

Process Modeling
  • Definition:

    • A graphical representation of processes that capture, manipulate, store, and distribute data.

    • Helps in understanding data flow between systems and components.

    • Utilizes information gathered during requirements determination.

  • Common Methods Used in Process Modeling:

    • Data Flow Diagram (DFD)

    • Entity Relationship Diagram (ERD)


2. Entity Relationship Diagram (ERD)
  • Definition:

    • A diagram that illustrates how entities (e.g., people, objects, or concepts) relate to each other within a system.

  • Purpose:

    • Used to model relational databases.

    • Helps in defining business logic.

    • Acts as an initial step in database design.

Benefits of ERDs:

  • Provides a conceptual data model.

  • Helps in understanding business rules.

  • Can be translated into relational tables.


3. Components of ERDs
  • Entities: Represent real-world objects (e.g., Employee, Car, House).

  • Attributes: Define the properties of an entity (e.g., EmpName, EmpAddr, EmpJob).

  • Primary Keys:

    • Uniquely identifies an entity.

    • Should be stable and unique (e.g., EmpID instead of EmpName).

    • Steps to define a Primary Key:

      1. Select an attribute.

      2. Underline it in the ERD.

  • Relationships:

    • Defines the association between entities.

    • Can be Unary, Binary, or Ternary.

    • Example: A "Student" lives in a "Residence Hall."


4. Relationships in ERDs
  • Degree of Relationship:

    • Unary: An entity is related to itself (e.g., "Employee manages Employee").

    • Binary: A relationship between two entities (e.g., "Student enrolls in Course").

    • Ternary: A relationship involving three entities.

  • Cardinality:

    • Defines how many instances of one entity relate to another.

    • Common values:

      • 1:1 (One-to-One)

      • 1:M (One-to-Many)

      • M:N (Many-to-Many)

    • Example:

      • 1:M: A customer places multiple orders.

      • M:N: Students enroll in multiple courses.

  • Multi-Valued Attributes:

    • Attributes that have multiple values for a single entity.

    • Example: An "Employee" can have multiple skills.

    • Fix: Convert them into a new entity.


5. Database Business Rules
  • Define constraints and conditions that must be followed.

  • Examples:

    • Online Gambling System: Must not accept users from locations where gambling is illegal.

    • Banking System: Declines purchases if insufficient funds.

    • Beer Information System: Must verify age (21+) before allowing a purchase.


6. Modeling Hints & Real-World Examples
  • The Marathoner Example:

    • A database tracks marathon runners and race performances.

    • A race has many participants.

    • Professional runners are uniquely identified.

  • Laboratory Example:

    • Tracks chemists, projects, and equipment usage.

    • Captures details such as chemist names, project IDs, and equipment costs.

  • Vendor & Production Example:

    • COO manages production runs.

    • Materials have preferred vendors and contract pricing.