Databases have become involved in virtually every aspect of our lives. Almost everyday, we encounter some kind of a database; while checking out items at the grocery store, making a hotel reservation, searching for a book at the library, etc.
So what is a database? It is a collection of related data. Databases have been around for so long, and in different forms. A paper record of information is a database. A text file with information in it can be considered as a database. However, the word Database has become more likely to refer to Relational Databases; a form of databases where data is arranged into tables, each of which consists of rows and columns. From now on, the term database will be used to mean a relational database, unless otherwise specified.
In a relational database, data is stored in tables (also known as relations). Each table usually represents an entity (an item, component, person, project, etc.). Each table has multiples columns (also called fields or attributes). These columns represent different properties of the entity represented by the table. For example, an employee table might have columns like name, hire date, salary, position, department, etc. Each row in that table represents one employee. Rows are also known as records or tuples (see Figure 1)

Figure 1 – Employee Table
Now, one cannot put all data in the same table. Why? Well, because things are different. They have different entity types. A student is not the same as an employee. It is true that they are both persons, but each of them has different properties that are of interest. An employee has a salary and a position, while a student has a major and a GPA score. So bottom line: different entities are stores in different tables, with each table containing the relevant columns (attributes) for that particular entity.
So why use databases? Why not just store everything in files? Actually, even databases store data in files on disk. However, to deal with that data, the user does not have to know the physical structure of these files (e.g. how the records are ordered in the file, the size of each record, etc.) All the user has to know is the logical representation of the data (i.e. the table names, what columns they have, etc.) This makes it possible to change the underlying file structure completely without having to get familiar with the new structure.
In order to hide the underlying details, the tables and their structure are encapsulated within a Database Management System (DBMS). A DBMS is the external shell that the user deals with when creating new tables, managing tables, dealing with the data in the tables, etc. There are many popular commercial DBMSs out there, such as Microsoft Access, SQL Server, DB2, Oracle, PostgreSQL, mySQL, etc.
DBMSs provide more flexibility when developing applications that deal with the data, since the applications can be made to interact only with the DBMS, without worrying about the underlying physical details of the file system on which the data is actually stored.
[...] primary key, relations, rows, tables, tuples — Amr El-Helw @ 12:05 am As mentioned in the previous post, the data in a database are organized into tables. A table (also referred to as a relation) is a [...]
Pingback by Database Tables « Database Land — December 9, 2007 @ 12:05 am