72.2.2 Advantages of the Relational Model
In our example of the Relational Model, we have the following relationships:
One [Customer] can relate to Many [Invoices].
One [Invoice] can relate to Many [Line Items].
Having set up these relations, we retain many of the benefits and some of the simplicity of the Flat File Model. At the same time, we gain four major benefits from the relational model: data lookups, flexibility, Analysis/Reporting, and Scalability.
We type in the customers name, address, and phone number one time in the Customer file. After that, instead of having to re-type the customers name and address, we can just type in the Customer Number and let the database query the Customer file to Lookup the customers name and address. This means that we are not duplicating the same name and address data each time we create a new invoice; it also means that data entry is faster and more accurate.
With data lookups, our invoice data entry screen might look like this:
A second advantage that we gain with the Relational Model is flexibility, because we don't have to know in advance how many line items we will have on an invoice. If an invoice has one line item or ten line items or one hundred line items, our system can handle it.
A third advantage of the Relational Model is that our analysis and reporting capabilities are far more powerful than with a simple flat file database. We can look at the information in many different ways. For example, we can ask our relational database the following questions:
How many invoices did we issue within a certain time period?
How many invoices did we issue to a certain customer?
How many customers have total invoices above or below a certain amount?
What is the total of the invoices within a certain time period, to a certain customer, above or below a certain amount?
Where (in what cities) do our best customers live?
Many other questions of the type: Who? What? When? Where? How Many? How much?
We might also have been able to answer those questions with our flat file database, but we could only have done it at the cost of a great deal of data duplication, uncertainty, and wasted space.
The fourth advantage of the relational model is scalability. Although we have used a 3-file database in our example, real-life relational databases can be much larger in scale. Because of the Scalability of the relational model, you can continue to add files to your database as your information storage needs grow and change.
In your Invoicing database, you could go on to create:
A Products file to store information about the products that you sell;
A Payments file to store information about the payments you receive from customers;
An Orders file to store information about the materials that you order from your suppliers;
An Historical file to store summary information about sales, products, payments, and orders.
This scalability - the ability to expand your database as your needs expand - is one of the primary advantages of the Relational Model.
|