Databases > General

 

What is a database?

Databases are in essence, a convenient method of storing data or information that can be modified or retrieved using a computer.

If you use a spreadsheet like Excel  then the data for the spreadsheet is stored in a database.
Outlook Express stores your email and contacts in a database.


MySQL Databases

The standard database for internet use is MySQL which is a version of the industry standard SQL (Structured Query Language).


Database Structure

If you wanted to store information about 5 peoples preferred bedtime drink then you could write it out longhand in text form as...
 
Mary's first preference is horlicks as a bedtime drink
Mary's second preference is tea as a bedtime drink
Mary's third preference is coffee as a bedtime drink
Mary's least preference is beer as a bedtime drink
Peter's first preference is beer as a bedtime drink
Peter's second preference is coffee as a bedtime drink
etc etc etc;

Or as a database this information could be stored similar to the following grid (table).

name tea coffee horlicks beer
John 1 3 2 4
Mary 2 3 1 4
Peter 3 2 4 1
David 3 4 1 2
Paul 3 4 2 1

If we do a database lookup for Mary we see that her beverage preferences are:
Horlicks: 1
Tea: 2
Coffee: 3
Beer: 4

If we do a database lookup for who has beer as their preferred bedtime drink, we find that both Peter & Paul rate it as their preferred drink. 

Or if we want to find out who prefers tea as a bedtime drink we find that John does.

 

For instance, if your website operates a monthly email newsletter that visitors can subscribe to then the chances are that you'll want to store some basic information about each user on your website.

This way, you could send each user a personalised newsletter rather than a 'generalised' one.

You might even want to 'filter' the recipient list by 'age' for instance...

A text list of your contacts... Name:Address:Telephone:Email is a simple database.

The problem is... As the contact list gets ever longer, filling numerous pages, you need a mechanism to extract the data on a 'line-by-line' basis.

It would also be useful to be able to update or modify a line of information as well; if a contact changes their address or telephone number etc.

 

unfinished helpfile..... more soon!