IT 21103/41103 System Analysis & Design
Chapter 04 Data Modeling
Concerned with the data flow of an organization
Data Modeling Focuses on Data Only
Data Modeling Data Attributes NameSizeType
Data Modeling Name Unique Indentifer
Data Modeling Size Amount of space required to hold the data
Data Modeling Type How the computer stores the data
Data Modeling Data Structures Specific organizational strategies for associating data elements
Data Modeling Examples:Receipts File Folders
Data Modeling Computer Data Structures Mimic the real-world Helps the analyst link data to the new system
Data Modeling Data Streams Series of characters that form a command or represent specific data values in a program
Data Modeling File Organized data structure with a specific format
Data Modeling Master File Identifies an individual person or thing in the organization
Data Modeling Transaction File Data collection that represents a specific event or activity
Data Modeling Database Collection of files containing data about the current operations of an organization
Data Modeling Data Warehouse Collection of files about the past operations of an organization
Data Modeling Relational Databases Collection of data tied together by common fields
Data Modeling Common Fields Primary Key Field(s) Foreign Key Field(s) - Create Relationships
Data Modeling Entity-Relationship Diagram - ERD
ERD ► The Entity-Relationship Approach Represents reality using well-defined graphics and rules ► Basic building blocks are “things” (entities) and relationships Member Animal M 1 Adopts
ERD ► Advantages Theoretical foundation (Set Theory) Good for communication Build E-R Model, then translate to any type of RDBMS ► Disadvantages Different (yet another new thing to learn) Must translate to the relational model
ERD ► Entity-Relationship Model: Basic Concepts Entity ► Thing, Object, Concept of interest to the enterprise ► Each occurrence can be uniquely identified
ERD ► Entity-Relationship Model: Basic Concepts Attribute ► Property of an entity ► Column
ERD ► Entity-Relationship Model: Basic Concepts Relationship ► Association between two (or more) entities
ERD ► Entity-Relationship Model: Basic Concepts Entity Identifier ► Attribute(s) whose value uniquely identifies an entity ► Primary Key
ERD ► What is an Entity? Physical entity types ► Person ► Building ► Machine ► Book ► Usually Singular
ERD ► What is an Entity? Conceptual entity types ► Contract ► Account ► Order ► Course
ERD ► What is an Entity? Event entity types ► Transaction ► Shipment ► Reservation ► Phone Call ► Seminar Offering
ERD ► Entity-Relationship Model: Diagrams Example: Soft Rectangle represents entities ► Noun ► Singular Connecting Line represents relationships ► Verb Member Animal Adopts
ERD ► Relationships have Characteristics A relationship has Cardinality (Degree) One-to-OneOne-to-Many Many-to-Many
ERD ► Each entity’s participation is Mandatory or Optional ► Cardinality & Optionality are based on business rules Mandatory Optional
ERD ► One:One Relationship One Member adopts one animal One Animal is adopted by one member Member Animal Adopts
ERD ► One:Many relationship One member adopts one animal One animal is adopted by many members Member Animal Adopts
ERD ► Many:Many relationship One member adopts many animals One animal is adopted by many members Member Animal Adopts
ERD ► Optionality: Participation in a Relationship Zoo Employee Animal Cares for
ERD ► Mandatory Every instance of the entity MUST participate in the relationship Example: ► Every animal is cared for by at least one employee
ERD ► Optional An instance of the entity CAN participate in the relationship Example: ► Some employees do not take care of animals
ERD ► Drawing an E-R Diagram Identify the entities Write (make up) a few attributes for each entity Designate the unique identifier (PK) Identify the relationship (FK goes on the many side) Show cardinality and optionality for each relationship
ERD ► E-R Modeling Exercise: A Seminar Company ► A seminar company offers more than 100 different courses Each course has a unique course number and a title ► The company schedules thousands of seminars annually Each seminar is the presentation of one specific course A seminar is either public or on-site
ERD ► E-R Model: Entities ► Course Course # (PK) Course Title Duration Author
ERD ► E-R Model: Entities ► Seminar Seminar # (PK) Date Place Type ► Public ► On-site Course # (FK)
ERD ► E-R Model: COURSE SEMINAR Presented by
ERD ► E-R Modeling Exercise: A Personnel Database ► A company has four divisions ► Each employee works for a department ► Each department reports to one of the divisions
ERD ► E-R Model: Entities ► Division Division # Division Name
ERD ► E-R Model: Entities ► Employee Employee # Employee Name Dept # (FK)
ERD ► E-R Model: Entities ► Department Dept # Dept Name Div # (FK)
ERD ► E-R Model: DIVISIONDEPARTMENT Reports to EMPLOYEE Works for
Relational Database Theory ► E-R Modeling Exercise: A Supplier-Parts Database ► A company purchases many parts from its suppliers Each part has only one supplier ► A supplier can supply zero, one, or many parts One _____(can/must) _____ (one and only one/one or more) ______
Relational Database Theory ► E-R Model: SUPPLIER PARTS Supplies
ERD Assignment 04 Page 117