Extended ER Features and Relational Algebra
As databases and logic grow more complex, standard ER modeling introduces specialized abstractions.
1. Generalization
Generalization is a bottom-up design process. It combines several lower-level entities that share the same attributes to produce a higher-level entity type.
- Example: Combining
Checking AccountandSavings Accountinto a generalAccountparent entity. - It hides differences and emphasizes similarities.
2. Specialization
Specialization is a top-down process. It breaks a single higher-level entity down into sub-groupings based on distinguishing characteristics.
- This represents an "IS-A" relationship (super class - subclass inheritance).
3. Aggregation
Aggregation is an abstraction where relationships between entities are treated as higher-level entity sets themselves. This is useful when a relationship needs to participate in another relationship.
Relational Algebra
Relational algebra provides a collection of algebraic operations that operate on relations (tables) and output structural data. It is the procedural baseline behind declarative languages like SQL.
| Operation | Symbol | Description |
|---|---|---|
| SELECT | σ | Rejects rows that do not satisfy a predicate condition. |
| PROJECT | π | Extracts specific columns from the relation. |
| UNION | ∪ | Combines all unique rows from two compatible tables. |
| Set Difference | − | Yields rows that are in table 1 but not in table 2. |
| CARTESIAN PRODUCT | × | Creates all possible pairs (combinations) of rows from two tables. |
| RENAME | ρ | Assigns a temporary name to the results of a relational algebra expression. |
| SET INTERSECTION | ∩ | List of all rows that appear in both tables simultaneously. |
| JOIN | ⨝ | Combines columns from two or more tables based on a related attribute. |
| ASSIGNMENT | ← | Stores the result in a temporary variable. |