The Digital Librarian
I felt the need to explain you a few things about databases. Because it is something we all are confronted with nowadays. Most people don’t realize it but the use of databases is all around us.
How can a database be defined? Well, imagine you’re going to a library, you look around in the shelves and after a while you find the book you are looking for.
You walk over to the librarian. Since you are new (no offence :P) at library stuff, the librarian will ask you for your name, address, phone number, gender (you never know), birthdate and he assigns you a unique membership number.
He fills the in the details on a card. The librarian puts the card together with hundreds of other membership cards in a wooden box. Organized by membership number.
Logical? Absolutely… Efficient? Not really…
The coming of the database has improved this process drastically. What a database does is actually just the same as the librarian. It stores the information you have giving him on digital cards.
These digital cards are called tables in a database. These tables contain data about whatever you want.
If we translate the story a little bit to the modern version it looks something like this:
Imagine you’re going to a library, you look around in the shelves and after a while you find the book you are looking for.
You walk over to the librarian. Since you are new (har har har) at library stuff, the librarian will ask you for your name, address, phone number, gender (you never know), birthdate and he assigns you a unique membership number.
He enters all the information in the program on his computer and clicks save. The program sends an insert command to the database. The database receives this command and writes this information in the membership table. This table is organized by membership number.
This table contains information about hundreds of other members.
It is not so that a database contains only 1 table. There can be a lot of tables stored.
I now took a table that defines members. But suppose that you also want to store the information about his car (in a library, yep.. why not..).
Then you could define a table CAR (or something like that). In this table you define all available cars, each car should be labeled with a unique CAR number.
Now there is a small problem. You have a table with members and a table with cars. But how can you, or the database for that matter, know which car belongs to which person?
Well at this point you can’t. Some extra information should be stored in the member table. The unique car number also needs to be stored here.
So you enter the unique car number for each member. Now you can look up the car per member by using this number.
A database should always avoid redundant information. So, each member, each car, each whatever you store, should be unique.
I now used the example of a library. But almost each supermarket, gas station, post office, … whatever company is using database in some way. Did you ever perform a search on the internet? Indeed my friend ;-)…
So far the basic information about a database. I hope it was a bit clear.