Data Concepts
Chapter 3 - The Entity-Relationship Model
- Elements of the Entity-Relationship Model
Introduced by Peter Chen in 1976
- Entities
entity - something that can be identified in the usrs' work environment (something that the user wants to track); i.e. EMPLOYEE Mary Doe, CUSTOMER 12345, SALES-ORDER 1000, etc.
entity class - groups of entities of a given type; i.e. EMPLOYEE
- Attributes
attribute (property) - describes a characteristic of an entity; i.e. EmployeeName, DateOfHire, JobSkillCode
attributes can be single or multiple valued (ie. courses taken); can also be composite (i.e. Address)
- Indentifiers
identifier attributes that name the entity instance (i.e. EmployeeID, EmployeeName)
identifiers can be unique or nonunique
composite identifiers consist of more than one attribute (i.e. [FirstName, LastName, PhoneExtension])
- Relationships
relationship - association between entities
degree of a relationship - number of entities in the relationship (most relationships are binary relationships
THREE TYPE OF BINARY RELATIONSHIPS:
- 1:1 - STUDENT - HIGH-SCHOOL-GRADUATED-FROM
- 1:N (1 to many) - DEPARTMENT - FACULTY
- N:M (many to many) - BOOK - AUTHOR
maximum cardinality - maximum number of elements that occur on one side of a relationship
These are examples of HAS-A relationships
ENTITY-RELATIONSHIP DIAGRAMS
minimum cardinality:
- Use oval (0) to indicate that an entity is not required
- Use hash (|) to indicate that an entity must exist
- Use crow's feet (/) to indicate that an entity may have many instances
File Types
- Master file
- Table file
- Transaction file
- Work file
- Report file
File Organization
- Sequential
- Linked Lists
- Hashed (Direct access / relative)
- Indexed (requires file of indicies)
- Indexed Sequential (ISAM, VSAM)
- Normalization
- Guidelines for File/Database Relation Design
- Each separate data entity should create a master file
- A specific data field should exist in only one master file
- Each master file / database relation should have programs to Create, Read, Update, and Delete records
- Making Use of the Database
- Choose a relation from the database
- Join two relations together
- Project columns from the relation
- Select rows from the relation
- Derive new attributes
- Index / sort rows
- Calculate totals and performance measures
- Present results
Exercises: (due - noon Nov. 24, 1998)
e-mail to summers_wayne@ColumbusState.edu your answers to problem #7 on page 649.