The Relational Model
The Relational Model
1. Hierarchical Model:
- Organizes data into a tree-like structure with parent-child relationships.
- Each parent can have multiple children, but each child has only one parent.
- Example: Organizational structures, file systems.
2. Network Model:
- More flexible than the hierarchical model; allows many-to-many relationships.
- Data is represented as records connected by links.
- Example: Telecommunications networks, transport systems.
3. Relational Model:
- Most widely used model, organizes data into tables (relations) of rows and
columns.
- Tables are connected through keys (Primary, Foreign keys).
- Uses Structured Query Language (SQL) for data manipulation.
- Example: Customer database, order processing systems.
4. Object-Oriented Model:
- Stores data in objects, similar to object-oriented programming.
- Supports inheritance, polymorphism, and encapsulation.
- Useful for complex data structures like multimedia, CAD systems.
Key Considerations:
- Relational Databases are better for structured data with complex relationships,
where consistency and transactions are critical.
- Non-relational Databases are ideal for unstructured or semi-structured data,
high-performance applications, and systems requiring large scalability.
- Books Table:
- ISBN (Primary Key)
- Title
- Author
- Publication Year
- Members Table:
- Member ID (Primary Key)
- Name
- Email
- Phone Number
Examples:
- E-commerce Platform: Requires managing product inventories, orders,
customer accounts (Relational Model).
- Social Media Application: Handles unstructured user-generated content,
multimedia, and requires scalability (Non-Relational Model).
Exercise:
- Given a blog application that stores posts, comments, and user profiles, decide
whether a relational or non-relational database is suitable and explain why.