Alpha Net Developers

Library & Articles
A Simple Explanation of Databases

Home >> Library & Articles >> A Simple Explanation of Databases

Library & Articles

A Simple Explanation of Databases

In its simplest form, a database is simply a collection of records containing information.

Each record contains information for a particular item in the database. The specific information collected for each item is stored in separate fields.

In the example below, each record applies to a specific individual.

contact table

The fields in the database are ID, last name, first name and social security number:

contact list

The diagram above shows the database laid out in a table, which is a favorite display format for looking at database information.

This simple database could be saved as a text database, which most database programs can easily read. This is what it looks like when it is saved as a text file:

In fact, this database file looks like this when you look at it in a simple text editor:

dbf view

As you can see, it does not display correctly and it has characters at the beginning of the file and throughout the file that you cannot read.

This particular database is in a "dbf" file format, which can only be directly read and interpreted by database applications that work with the the "dbf" format.

There are many database programs on the market today. Each one has its own proprietary format which is designed to be read, interpreted and manipulated by its particular database engine. The "dbf" format shown above is owned by Borland's dBase IV database program. The file extension "dbf" is an acronym for "Data Base Format" and is one of the database formats that is an industry standard.

Other proprietary database engines cannot directly read, interpret and manipulate it. The file must be converted to the new format or another program must be used to interpret between the two different formats.

As an example, Microsoft SQL Server, which is a database program, will not be able to directly read this file. You will have to either install a program to interpret the file or you will have to convert the file to the specific format owned by Microsoft SQL Server.

The major database software firms have developed a set of standards to ease conversion issues. This is called "SQL" which is an acronym for "Structured Query Language". Each participating database firm agrees on a set of instructions that will be common to all that will allow other databases to access and read their particular database format.

They have also agreed to create programs that allow other databases to access their file formats. These are called "drivers". These type of drivers are called ODBC drivers. ODBC is an acronym for "Open Data Base Connectivity". You simply install the appropriate driver for the file you want to access and manipulate, and you can then connect to it and use it from another proprietary system.

Note: This is a very simple explanation of how this works and so it is not entirely accurate, but for the purposes of this tutorial, these explanations will serve.

Relational Databases

Databases can become enormous, containing millions of records. Each record takes up space on the hard drive of the computer. In a simple flat-file database the file might look like this:

contact table relationships

The problem here is that the first and last names are being repeated, which takes up unnecessary disk space.

The relational database format was created to overcome this problem. In a relational database the file is reorganized like this:

contact table relational database diagram

The file is split up into two separate tables that are related. The contact table contains the list of names, which are entered one time and one time only, never again entered to the database.

The second table contains only transactions. The two tables are matched up using the ID number from the contact table. That way only the ID number must be saved in the second table. The database engine does the work of matching the two sets of tables and ensuring that any changes made to one will be reflected in the other.

As an example, if you delete ID 10001 from the contact table, the matching transactions in the transactions tables will also be deleted. This is called referential integrity. The database engine performs this task automatically if it has been given instructions to do so.

Text databases are not relational in nature. They can be organized so they can be imported to a relational database program, but since they are just text files, they do not have a corresponding database engine to automatically manage the relationships.

The Three Parts of a Database Program

In summary, there are three basic parts common to all database programs:

  1. The files containing the data.
  2. The database engine that reads, interprets and manipulates the information in the files. The engine manages the files and it provides commands that can be executed by the end-user to manipulate or change the information in the files.
  3. The display interface that allows the end-user to see the results of the commands given to the database engine. The information is usually displayed in a table, although with some database programs, all you get is a printout to the computer screen in text.

Ownership Issues

When you purchase a database program, you are really only purchasing a license to use the database engine and its accompanying display interface program.

You may be the owner of the design and structure of the tables you have created with the database, if you designed it or you have specifically acquired the ownership rights from the individual or company that designed it. If you are using outside firms and you do not have a specific contract stating that you own it, you do not own it and you cannot prevent it from being sold or used by another client of that individual or company. By default, the ownership resides with the author of the database design.

You do own the information that is stored in the database by default, however, you should ensure that your outside firm has agreed not to reveal or use that information outside of the scope of your project.