Previous | Table of Contents | Next

Page 14

non-transactional environment. To compete, RDBMS vendors have made universal servers commercially available to offer OO/multimedia capabilities, including text, audio, image, and video data types. Oracle's Universal Server is an example. In addition, user-defined data types, or extensible types, have been augmented or added to the core database servers. Oracle8 offers such capability. RDBMS products like these are considered hybrid, yet they are clearly more mainstream than ever.

Furthermore, Multi-Dimensional Databases (MDDs) have found some market share. These databases offer highly indexed data for applications with many variables that must be multi-dimensionally accessed and tabulated, such as behavioral science data. In traditional RDBMSs, this would be nearly impossible to implement, let alone use. Again, to compete with MDDs, RDBMS vendors offer some layered products of their own that provide super-indexed data and use special techniques such as bit-mapped indexes. Oracle's Express is an example.

Using the Relational Model

We've already discussed the major responsibilities of a DBMS, so to understand what constitutes an RDBMS, we must first cover the relational model. A relational model is one in which:

What is a relation? It's a mathematical concept describing how the elements of two sets relate, or correspond to each other. Hence, the relational model is founded in mathematics. For our purposes, however, a relation is nothing more or less than a table with some special properties. A relational model organizes data into tables and only tables. The customers, the database designer, the DBA, and the users all view the data the same way: as tables. Tables, then, are the lingua franca of the relational model.

A relational table has a set of named attributes, or columns, and a set of tuples, or rows. Sometimes a column is referred to as a field. Sometimes a row is referred to as a record. A row- and-column intersection is usually referred to as a cell. The columns are placeholders, having domains, or data types, such as character or integer. The rows themselves are the data. Table 1.1 has three columns and four rows.

Table 1.1 Car Table


Make Model Cost
Toyota Camry $25K
Honda Accord $23K
Ford Taurus $20K
Volkswagen Passat $20K

Page 15

A relational table must meet some special properties to be part of the relational model:

In addition to tables and their properties, the relational model has its own special operations. Rather than get deeper and deeper into relational mathematics, suffice it to say that these operations allow for subsets of columns, subsets of rows, joins of tables, and other mathematical set operations such as union. What really matters is that these operations take tables as input and produce tables as output. SQL is the current ANSI standard language for RDBMSs, and it embodies these relational operations.

Before SQL became dominant, a competing language was QUErL, or QUEry Language, from Ingres. Another was UDL, or Unified Data Language. ANSI, the American National Standards Institute, is a standards body with very broad scope, one that includes computer software languages such as SQL. The primary statements that permit data manipulation, or data access, are SELECT, INSERT, UPDATE, and DELETE. Hence, any one of these data manipulation operations is a transaction, as we discussed earlier in the chapter.

The primary statements that permit data definition, or structural access, are CREATE, ALTER, and DROP. All of these statements are replete with a slew of clauses that permit many variations with which to define and access the structure and data of the relational tables, which make up your database. Hence, SQL is both a Data Definition Language (DDL) and a Data Manipulation Language (DML). A unified DDL and DML is inherently more productive and useful than two different languages and interfaces. The DBAs and the users access the database through the same overall language.

The last thing the relational model requires are two fundamental integrity rules. These are the entity integrity rule and the referential integrity rule. First, two definitions:

A primary key is a column or set of columns that uniquely identifies rows. Sometimes, more than one column or sets of columns can act as the primary key.
A primary key that is made up of multiple columns is called a concatenated key, a compound key, or, more often, a composite key.

Page 16

The database designer decides which combination of columns most accurately and efficiently reflects the business situation. This does not mean the other data isn't stored, just that one set of columns is chosen to serve as the primary key.

The remaining possible primary keys are referred to as candidate keys, or alternate keys. A foreign key is a column or set of columns in one table that exist as the primary key in another table. A foreign key in one table is said to reference the primary key of another table. The entity integrity rule simply states that the primary key cannot be totally nor partially empty, or null. The referential integrity rule simply states that a foreign key must either be null or match a currently existing value of the primary key that it references.

An RDBMS, then, is a DBMS that is built upon the preceding foundations of the relational model and generally satisfies all of the requirements mentioned. However, what happened when RDBMSs were first being sold, in the late seventies through the early eighties, was that SQL was being slapped on top of essentially non-relational systems and being called relational. This triggered some corrective movements; namely, Codd's Twelve Rules (1985).

Using Codd's Twelve Rules

Codd proposed twelve rules that a DBMS should follow to be classified as fully relational:

  1. The information rule. Information is to be represented as data stored in cells. As we discussed earlier, the use of VIN as a single column violates this rule.
  2. The guaranteed access rule. Each data item must be accessible by combination of table name + primary key of the row + column name. For example, if you could access a column by using arrays or pointers, then this would violate this rule.
  3. Nulls must be used in a consistent manner. If a Null is treated as a 0 for missing numeric values and as a blank for missing character values, then this violates this rule. Nulls should simply be missing data and have no values. If values are desired for missing data, vendors usually offer the ability to use defaults for this purpose.
  4. An active, online data dictionary should be stored as relational tables and accessible through the regular data access language. If any part of the data dictionary were stored in operating system files, this would violate this rule.
  5. The data access language must provide all means of access and be the only means of access, except possibly for low-level access routines (see rule 12). If you could access the file supporting a table, through a utility other than an SQL interface, this might violate this rule. See rule 12.
  6. All views that may be updatable should be updatable. If, for example, you could join three tables as the basis for a view, but not be able to update that view, then this rule would be violated.
  7. There must be set-level inserts, updates, and deletes. Currently, this is provided by most RDBMS vendors to some degree.

Previous | Table of Contents | Next