Database Reference
In-Depth Information
EmployeeNumber
FirstName
LastName
Department
Email
Phone
100
Jerry
Johnson
Accounting
JJ@somewhere.com
834-1101
200
Mary
Abernathy
Finance
MA@somewhere.com
834-2101
300
Liz
Smathers
Finance
LS@somewhere.com
834-2102
400
Tom
Caruthers
Accounting
TC@somewhere.com
834-1102
500
Tom
Jackson
Production
TJ@somewhere.com
834-4101
600
Eleanore
Caldera
Legal
EC@somewhere.com
834-3101
834-3102
700
Richard
Bandalone
Legal
RB@somewhere.com
Further, in a relation, all of the values in a column are of the same kind. If, for example, the
second column of the first row of a relation has FirstName, then the second column of every row
in the relation has FirstName. This is an important requirement that is known as the domain in-
tegrity constraint , where the term domain means a grouping of data that meets a specific type
definition. For example, FirstName would have a domain of names such as Albert , Bruce , Cathy ,
David , Edith , and so forth, and all values of FirstName must come from the names in that domain.
The EMPLOYEE table shown in Figure 3-5 meets these criteria and is a relation.
Figure 3-5
Sample EMPLOYEE
relation
By The WAy Columns in different relations may have the same name. In Chapter 2, for
example, two relations had a column named SKU. When there is risk of
confusion, we precede the column name with the relation name followed by a period.
Thus, the name of the SKU column in the SKU_DATA relation is SKU_DATA.SKU, and
column C1 of relation R1 is named R1.C1. Because relation names are unique within a
database and because column names are unique within a relation, the combination of
relation name and column name uniquely identifies every column in the database.
Figure 3-6
Nonrelational table—
Multiple Entries
per Cell
Each cell of a relation has only a single value or item; multiple entries are not allowed.
The table in Figure 3-6 is not a relation because the Phone values of employees Caruthers and
Bandalone store multiple phone numbers.
EmployeeNumber
FirstName
LastName
Department
Email
Phone
100
Jerry
Johnson
Accounting
JJ@somewhere.com
834-1101
200
Mary
Abernathy
Finance
MA@somewhere.com
834-2101
300
Liz
Smathers
Finance
LS@somewhere.com
834-2102
400
Tom
Caruthers
Accounting
TC@somewhere.com
834-1102,
834-1191,
834-1192
500
Tom
Jackson
Production
TJ@somewhere.com
834-4101
600
Eleanore
Caldera
Legal
EC@somewhere.com
834-3101
834-3102,
834-3191
700
Richard
Bandalone
Legal
RB@somewhere.com
 
 
Search WWH ::




Custom Search