Structure of Relational Databases
A relational database consists of a collection of tables, each of which is assigned a
unique name. For example, consider the instructor table of Figure 2.1, which stores
information about instructors. The table has four column headers: ID, name, dept_
name, and salary. Each row of this table records information about an instructor,
consisting of the instructor’s ID, name, dept_name, and salary. Similarly, the course
table of Figure 2.2 stores information about courses, consisting of a course_id, title,
dept_name, and credits, for each course. Note that each instructor is identified by
the value of the column ID, while each course is identified by the value of the
Figure 2.3 shows a third table, prereq,which stores the prerequisite courses for
each course. The table has two columns, course_id and prereq_id. Each row consists
of a pair of course identifiers such that the second course is a prerequisite for the
Thus, a row in the prereq table indicates that two courses are related in the
sense that one course is a prerequisite for the other. As another example, we
consider the table instructor, a row in the table can be thought of as representing
the relationship between a specified ID and the corresponding values for name,
dept_name, and salary values.
In general, a row in a table represents a relationship among a set of values.
Since a table is a collection of such relationships, there is a close correspondence
between the concept of table and the mathematical concept of relation, fromwhich
the relational data model takes its name. In mathematical terminology, a tuple is
simply a sequence (or list) of values. A relationship between n values is represented
mathematically by an n-tuple of values, i.e., a tuple with n values, which
corresponds to a row in a table.
Thus, in the relational model the term relation is used to refer to a table, while
the term tuple is used to refer to a row. Similarly, the term attribute refers to a
column of a table.
Examining Figure 2.1,we can see that the relation instructor has four attributes:
ID, name, dept_name, and salary.
We use the term relation instance to refer to a specific instance of a relation,
i.e., containing a specific set of rows. The instance of instructor shown in Figure 2.1
has 12 tuples, corresponding to 12 instructors.