|Lesson 2||The relational database model |
|Objective||Describe 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:
- A table is the largest structure.
- A field (column) is the smallest structure.
- 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.
The relational model
consists of five components:
- An open ended collection of scalar types, including type BOOLEAN in particular
- A relation type generator and an intended interpretation for relations of types generated thereby
- Facilities for defining relation variables of such generated relation types
- A relational assignment operator for assigning relation values to such relation variables
- 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
- a row is called a tuple,
- a column header is called an attribute, and
- 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.
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.
A collection of data arranged in rows and columns is known as a table and is the largest structure in a relational database.
The smallest structure in a table; contains data describing the subject of a table.