Page 202 -
P. 202
201
Q5-2 What Is a Database?
Every table must have a key. The key of the Email table is EmailNum, and the key of the Office_
Visit table is VisitID. Sometimes more than one column is needed to form a unique identifier. In a
table called City, for example, the key would consist of the combination of columns (City, State)
because a given city name can appear in more than one state.
Student Number is not the key of the Email or the Office_Visit tables. We know that about Email
because there are two rows in Email that have the Student Number value 1325. The value 1325
does not identify a unique row; therefore, Student Number cannot be the key of Email.
Nor is Student Number a key of Office_Visit, although you cannot tell that from the data in
Figure 5-6. If you think about it, however, there is nothing to prevent a student from visiting a
professor more than once. If that were to happen, there would be two rows in Office_Visit with the
same value of Student Number. It just happens that no student has visited twice in the limited data
in Figure 5-6.
In both Email and Office_Visit, Student Number is a key, but it is a key of a different table, namely
Student. Hence, the columns that fulfill a role like that of Student Number in the Email and Office_
Visit tables are called foreign keys. This term is used because such columns are keys, but they are
keys of a different (foreign) table than the one in which they reside.
Before we go on, databases that carry their data in the form of tables and that represent
relationships using foreign keys are called relational databases. (The term relational is used
because another, more formal name for a table like those we’re discussing is relation.) You’ll learn
about another kind of database, or data store, in Q5-8 and in Case Study 5.
Metadata
Recall the definition of database: A database is a self-describing collection of integrated records.
The records are integrated because, as you just learned, rows can be linked together by their key/
foreign key relationship. Relationships among rows are represented in the database. But what does
self-describing mean?
Database technology puts It means that a database contains, within itself, a description of its contents. Think of a library.
unprecedented ability to conceive A library is a self-describing collection of books and other materials. It is self-describing because
information into the hands of the library contains a catalog that describes the library’s contents. The same idea also pertains to a
users. But what do you do with
that information when you find database. Databases are self-describing because they contain not only data, but also data about the
something objectionable? See the data in the database.
Ethics Guide on pages 202–203 Metadata is data that describes data. Figure 5-7 shows metadata for the Email table. The format
for an example case. of metadata depends on the software product that is processing the database. Figure 5-7 shows the
Figure 5-7
Sample Metadata (in Access)
Source: © Access 2013, Microsoft
Corporation