Understanding Business Rules
Importance of comprehending business rules discussed in previous sessions.
Awareness of the essential concepts will aid in lab assignments, specifically in building an ERD (Entity-Relationship Diagram).
Importance of Information
Companies rely on accurate information for survival and effective decision-making.
Conflicting versions of data cause redundancy and reliability issues.
Types of Databases
Transaction Database:
Tracks day-to-day transactions, such as sales and payments.
Non-reporting environment, time-critical in operation.
Data Warehouse:
Focuses on data storage for strategic information generation.
Not a replica of the transaction database; only necessary data is stored.
Importance of Database Design
A well-structured database prevents data anomalies and redundancy.
Organizational rules dictate how data is structured; failure leads to inefficient databases.
Entities, Attributes, Keys, Relationships
Entities:
Fundamental components (e.g., a person, corporation). Each entity corresponds to a table.
Attributes:
Characteristics of an entity (e.g., car model, year). These become fields in the physical database.
Primary Key:
Unique identifier for an entity (e.g., Customer ID). Important for record identification.
Foreign Key:
A reference to a primary key in another table, establishing a relationship.
Relationships:
Connections between entities based on business rules.
Three relationship types: one-to-many, many-to-many, one-to-one.
Cardinality in Relationships
One-to-Many:
Preferred structure (e.g., a vendor sells many products).
Many-to-Many:
Avoided; requires a bridge table to fix structural issues.
One-to-One:
Each entity is related to precisely one entity of another type (e.g., a professor chairs a department).
Entity and Referential Integrity
Entity Integrity:
All records must be uniquely identified in a table, ensuring successful record searches.
Referential Integrity:
Ensures foreign key values correspond to valid entries in referenced tables. Key in maintaining data accuracy and preventing invalid data entries.
Creating ERDs
Entities in ERDs should be singular in naming (e.g., Customer not Customers).
Highlight primary keys (PK) in ERDs; foreign keys do not require underlining.
Use clear visual representation (rectangles for entities, lines for relationships).
Lab Assignments and Business Rules
Roles of students highlighting the importance of clarifying entity relationships based on business rules.
Emphasis on the need to create bridge tables in case of many-to-many relationships to avoid redundancy.