Learning Objectives

By the end of this chapter, you will be able to:

  • Define a database model.
  • Describe the hierarchical and network models.
  • Explain the structure of the relational model.
  • Understand the importance of the relational model in modern databases.

What are Database Models?

A database model is a set of rules and standards that defines the logical structure of a database. It determines how data is stored, organized, and manipulated. Several models have been developed over the years, but the relational model is by far the most common.

1. Hierarchical Model

This is one of the oldest models. It organizes data in a tree-like structure, with a single root at the top and branches below. Each child record has only one parent.

  • Analogy: A family tree.
  • Disadvantage: It is very rigid. You can only access data by starting at the root and moving down the tree.

2. Network Model

The network model is an extension of the hierarchical model. It allows each child record to have multiple parent records, creating a more flexible, graph-like structure.

  • Advantage: More flexible than the hierarchical model.
  • Disadvantage: Still complex to navigate and manage.

3. Relational Model

Developed by E.F. Codd in 1970, the relational model is the basis for almost all modern database systems. It organizes data into simple two-dimensional tables (also called relations), which are composed of rows and columns.

  • Tables: Store data about a specific entity (e.g., Customers, Products).
  • Rows (Records): Represent a single instance of that entity (e.g., one customer).
  • Columns (Fields): Represent an attribute of that entity (e.g., CustomerName).

Tables are linked together using keys. The data can be easily manipulated and queried using a specialized language, most commonly SQL (Structured Query Language).

  • Advantage: Very flexible, easy to understand, and allows for powerful querying of data.

Summary

Database models define the logical structure of a database. While early models like the hierarchical and network models were influential, they were largely replaced by the much more flexible and powerful relational model. The relational model, which organizes data into simple tables, is the foundation of nearly all modern databases and is queried using the standard language SQL.

Key Takeaways

  • A database model defines the logical structure of a database.
  • The hierarchical model is a rigid tree-like structure.
  • The network model is a more flexible graph-like structure.
  • The relational model, which uses tables, is the most common model used today.

Discussion Questions

  1. Why is the relational model so much more popular than the hierarchical or network models?
  2. What is the role of SQL in a relational database?
  3. Draw a simple relational database with two tables (e.g., Students and Courses) and show how they might be related.