Introduction to databases
A database is a file (or files) in which you can store, related data. This data is stored
in a very specific way to make the data easy to search and update.
A database contains tables with rows that we call records. Every record contains
fields. For every record in a table the meaning a particular field is the same.
For example, a table with address data contains records with the fields address, zip code,
place, etc.
Tables in a database can be related to each other, for example a table with data regarding
persons can be related to a table with address data. Every record in the table with address
data will then contain a reference to a certain record in the table with person data. When
every addres refers to another person, the relationship is called a 1-to-1 relationship. When
more addresses refer to one person, this is called a 1-to-many relationship. We can also make
a many-to-many relationship using a third table that has references to both tables.
What is SQL?
To be able to manipulate the data in a database, we need a mechanisme
that helps us to tell the database which data we want to see, change, remove or insert.
For this we use SQL, which stands for Structured Query Language.
An importent aspect of SQL is that it treats the database as a set (or collection)
of data. This means that in the tables there isn't a "first" or "last" record. If you want
to request the records in a certain order, you have to state this explicitly.
ADO, OLEDB and ODBC
With ASP (or other programming environments) you can't work directly with a database. For this
you need a so called API (Application Programmer Interface).
And a connection with the database. Such a connection is made with
OLEDB or ODBC. They both do the same things, but OLEDB is newer, more flexible and faster.
ODBC however supports more databases. You can use OLEDB (or ODBC) via ADO. ADO stands for
ActiveX Data Ojects. ADO is a collection of objects that serve as API.
To understand the above, you can compair it all to our telephone network.
ODBC can be compaired to an analoge telephone network, OLEDB with IDSN (same function
only faster and more advanced). ADO is the telephone set and with SQL we state
which data we want to have, like dialing a number tells who we want to talk to.
|