M358 - Structure of Relations
fellstrider.com - the logo!
Home| OU Study Rooms | M358 Index | Block 1 - Information Systems | Block 2 - Relational Theory
Structure of Relations

A relation is like a table where the attributes are the columns. A relation is its attributes. Each row of the table is an occurrence.

enrolment
StudentId CourseCode TutorNo
s01 c4 3158
s05 c2 5324
s05 c7 5324
s07 c4 3158

A row can be written as follows:

< s01, c4, 3158 >

This corresponds with to the occurrence in the first row of the table.

Properties of Relations

There are rules that control this type of table:

  1. Each value in the table is atomic. i.e. the value in a column is always just one value.
  2. Each attribute value in each column are always of the same type. They are drawn from the same domain.
  3. Each column has a different name.
  4. Each row is unique. At least one of the attributes (or a combination of) will form a key. A single attribute or the smallest combination of attributes will form a primary key. This is mandatory for a table to be a depiction of a relation. In our table above it will be necessary to form a primary key from StudentId and CourseCode.
  5. There is no significance to the ordering of rows and columns. It is not possible to refer to a column or row by its position. A column must be referred to by its name. A row must be referred to by its primary key.

A relation is an abstract structure. A table is simply a depiction of the structure. Any reference to rows and columns are references to the depiction and not the abstraction.

Relational Terminology

Specific terminology is used to depict relations to take away the references to tabular concerns of row and column:

Depiction of some relational terminology through a table.

The heading of such a relation should be written as follows:

Enrolment (StudentId, CourseCode, TutorNo)

The primary key is placed first and underlined.

A natural language predicate is a device to define the meaning of a relation:

<a, b, c > is a tuple of Enrolment only if a student with StudentId of 'a' takes CourseCode 'b' tutored by TutorNo 'c'.

Null

Occassionally an attribute may not have a value determined. The value can be replaced by a marker. This marker is not a value. The natural language predicate where there may be no tutor allotted is shown below.

<a, b, c > is a tuple of Enrolment only if a student with StudentId of 'a' takes CourseCode 'b' is either tutored by TutorNo 'c' or 'c' is null.
Home| OU Study Rooms | M358 Index | Block 1 - Information Systems | Block 2 - Relational Theory
Move on to Structure of Relational Models - Domains.

Valid CSS! Valid XHTML 1.0!

Comments, suggestions, ideas to
Stuart Banner