Databases are computerized systems that collect and store data so it can be cross-referenced through links to related data within the collection as well as related information in other databases. There are many purposes and types of databases. Relational databases are among the most common. For example, customer relationship management (CRM) databases, which manage sales leads, customer records, management and billing, are relational databases.
In a relational database, a table is the same as a record, which is the fundamental data component. It is comprised of a set of fields that are the same in every table or record, such as the name, address and product of the customer. Relational databases also dictate how the tables work. For example, relational databases control how the data is presented on-screen and organized for output--dictated by query and data-definition language--and even how much information can be stored in a given field.
Relational database tables look much like an Excel spreadsheet when diagrammed for visual reference. The rows in each database table represent sequential values where the value in row 1A, for example, relates to the values in all the other fields in row 1. The type of value in row 1A, i.e. the name John Smith, is the same type of value as in all other rows in column A. Each row represents the sum of data for an entire record or a subcategory of a record, such as customer contact information that would include John Smith's address, telephone number and email address.
Columns in a relational database table are control features; each column represents a field of data that occurs consistently in each record or table throughout the database. For example, in the model CRM database visual representation, the columns would have headers such as "name," "address," "telephone" and "email." These column names are the names of the data fields that occur in each record.
Primary keys are identification tags for each row of data. The primary key is different for every record in the relational database; it must be unique and it must exist (in other words, it can not be "null"). In the CRM database, this primary key might be a number assigned to the customer or be a unique identifier such as her Social Security number. Primary keys are used for queries within the relational database but not for queries to external databases.
Foreign keys allow data searches and manipulation between the primary database table and other related databases. In the CRM model, there might be a database of product types, listing manufacturers of different widgets. Each widget type would be assigned a foreign key allowing the CRM user to make a search to determine if a certain customer is one its manufacturers. For example, a widget category called "X" might be assigned the foreign key of "1," and have many subcategories labeled alphabetically. The search for foreign key 1 shows how many items are in category X, and when an item is viewed, the record shows its category designation.