Database Design   «Prev  Next»

Lesson 2The relational database model
ObjectiveDescribe the Relational Database Model

Describe Relational Database Model

The structure of every database is determined by a database model. A database model is a formal structure for organizing and linking data in a database.

The Relational Model

A relational database is based on the relational model, which organizes data into tables comprising columns and rows. In the relational database model:
  1. A table[1] is the largest structure.
  2. A field[2] (column) is the smallest structure.
  3. A record: (row) contains all the fields in a table. A particular instance of the subject of a table.
Table, field, and record are terms typically used in general database discussions. Table, column, and row are used to physically describe a tabular format.

Definition: The relational model consists of five components:
  1. An open ended collection of scalar types, including type BOOLEAN in particular
  2. A relation type generator and an intended interpretation for relations of types generated thereby
  3. Facilities for defining relation variables of such generated relation types
  4. A relational assignment operator for assigning relation values to such relation variables
  5. A relationally complete (but otherwise open ended) collection of generic relational operators for deriving relation values from other relation values

Relational Model Concepts

The relational model represents the database as a collection of relations. Informally, each relation resembles a table of values or, to some extent, a flat file of records. It is called a flat file because each record has a simple linear or flat structure. There are important differences between relations and files, as we shall soon see. When a relation is thought of as a table of values, each row in the table represents a collection of related data values.
A row represents a fact that typically corresponds to a real-world entity or relationship. The table name and column names are used to help to interpret the meaning of the values in each row. For example, a student table is called STUDENT because each row represents facts about a particular student entity. The column names 1) Name, 2) Student_number, 3) Class, and 4) Major specify how to interpret the data values in each row, based on the column each value is in. All values in a column are of the same data type.
In the formal relational model terminology,
  1. a row is called a tuple,
  2. a column header is called an attribute, and
  3. the table is called a relation.
The data type describing the types of values that can appear in each column is represented by a domain of possible values.

XML model

The XML model has emerged as a standard for exchanging data over the Web, and has been used as a basis for implementing several prototype native XML systems. XML uses hierarchical tree structures. It combines database concepts with concepts from document representation models. Data is represented as elements; with the use of tags, data can be nested to create complex hierarchical structures. This model conceptually resembles the object model but uses different terminology. XML capabilities have been added to many commercial DBMS products. In the next lesson, we will examine a relational database table in detail.
[1] table: A collection of data arranged in rows and columns is known as a table and is the largest structure in a relational database.
[2] field: The smallest structure in a table; contains data describing the subject of a table.