Datasheet
15
Chapter 1: Relational Database Fundamentals
year, team, games played, at-bats, hits, runs scored, runs batted in, doubles,
triples, home runs, bases on balls, steals, and batting average. A row covers
each year that the player has played in the Major Leagues. You can also store
this data in a relation (a table), which has the same basic structure. Figure
1-2 shows a relational database table holding the offensive statistics for a
single major-league player. In practice, such a table would hold the statistics
for an entire team — or perhaps the whole league.
Figure 1-2:
A table
showing
a baseball
player’s
offensive
statistics.
Roberts
Roberts
Roberts
1988
1989
1990
Padres
Padres
Padres
5
117
149
9
329
556
3
99
172
0
15
36
0
8
3
0
3
9
.333
.301
.309
Year
At
BatPlayer Team Game Hits
1
81
104
Runs
0
25
44
RBI 2B 3B HR
1
49
55
Walk
0
21
46
Steals
Bat.
Avg.
Columns in the array are self-consistent: A column has the same meaning in
every row. If a column contains a player’s last name in one row, the column
must contain a player’s last name in all rows. The order in which the rows
and columns appear in the array has no significance. As far as the DBMS is
concerned, it doesn’t matter which column is first, which is next, and which
is last. The same is true of rows. The DBMS processes the table the same way
regardless of the organization.
Every column in a database table embodies a single attribute of the table,
just like that baseball card. The column’s meaning is the same for every row
of the table. A table may, for example, contain the names, addresses, and
telephone numbers of all an organization’s customers. Each row in the table
(also called a record, or a tuple) holds the data for a single customer. Each
column holds a single attribute — such as customer number, customer name,
customer street, customer city, customer state, customer postal code, or
customer telephone number. Figure 1-3 shows some of the rows and columns
of such a table.
The relations in this database model correspond to tables in any database
based on the model. Try to say that ten times fast.