Database Reference
In-Depth Information
relational database . In a relational database, data is organized in tables that are
linked together. See, for instance, the following example database consisting of
three tables, Student, Course, and Grade.
Student
SID
Fname
Sname
Dob
0001
John
Williams
10/05/1985
0002
Peter
Peterson
08/09/1984
0003
Ann
Van Hee
07/05/1986
Course
Code
Name
Lecturer
2II15
Datamining
T. Calders
2ID45
Databases
G. Fletcher
Grade
SID
Code
Grade
0001
2II15
7
0002
2II15
6
Fig. 2.1 Example of a relational database consisting of three relations
Every row in a table will be called a tuple or a record , and every column
corresponds to a specific characteristic, or attribute of the tuple.
Example 5 (Relational Database). In the table Student in Figure 2.1, every tuple
corresponds to one particular student. For every student, the name (attributes
fname and sname), the student identity (attribute SID), and date of birth (attribute
dob) are recorded.
Every table has one or more attributes, that together uniquely define the identity of
the objects stored in the table. Such a specially designated combination of
attributes is called the primary key of the table. For example, in students SID is the
primary key, in courses Code is the primary key, and in the table Grade, the
combination of the attributes SID and Code form a primary key. The primary keys
are used to establish the links between the tables. For instance, in table Grade, the
primary key of Student, i.e., SID, is used to link to a particular student for which
the grade is being recorded. A good database design reduces the redundancy and
inconsistency in the data. Redundancy refers to the unnecessary repetition of
information. Suppose, for instance that next to the SID, the table grade would also
include the other attributes of students, then we would repeat a student's name and
date of birth for every course the student has a recorded grade. Not only would
this be wasteful, it would also lead to inconsistencies in the data; there could be
different tuples with the same identity, but a different date of birth. With a good
database design many of such problems can be avoided automatically.
Search WWH ::




Custom Search