relationships

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Originally, databases were sets of "flat files." Like Excel Lists, they were
sets of records with common fields for each row in the dataset. The
development of relational databases was a major breakthrough. So what makes
relationships so important? What are some of the values of creating multiple
tables with relationships to each other as opposed to putting all of the data
in a single set of records?
 
The main idea behind relational databases is storing each piece of data
only once. This results in a number of benefits including (to name but a
few major ones):

1. Reduction in database size
2. Increased data consistency
3. Improved performance

The first one is the most obvious one, but not necessarily the most
important one - at least in my view.

Increased data consistency is a result of storing data only once. To
give you a simple example, in the case of an invoicing database:

* with a flat table, you would have to repeat the name, address etc. of
a customer as many times as the sum of item lines in each invoice! How
can you exclude typing mistakes? What if the address changes?

*in a relational database, you just type in (or select from a list) the
customer code once everytime a new order is entered; no names, addresses
etc. typed in. Should an address change, you just change it in one
record in the customers table.

Improved performance comes not only fom the fact that the database
itself is smaller (again, the obvious part) but, most importantly, form
the fact that fields participating in table relationships are indexed,
which greatly improves search speed.

For Larry Ellison, in particular, it also makes the difference between
being one of the 50 wealthiest people in the world, and being just
another one of us common people.

HTH,
Nikos
 
Well, I guess the most obvious key advantage is efficiency. Consider
the simple example of trying to keep track of people's borrowing of
books from a library. If it was a single set of records, then every
time a person borrowed a book, you would need to input all the
information that was required to identify the book (e.g. title, author,
copy, etc,) and also all the information that was required to identify
the borrower (e.g. name, address, phone number, etc.). If a person
borrows 100 books, you have to enter his name, address, phone number,
etc 100 times. This is time consuming, and also prone to error. By
using related tables, you only have to enter each person's information
once, regardless of how many books they borrow, and you only have to
enter the details of each book once, regardless of how many people
borrow it.
 
Back
Top