Databases Reference
In-Depth Information
0-11-
3 45678-9
222-222-
2 222
Small
House
714-000-
0 000
Moby-Dick 2
Melville
3
$49.00
0-12-
3 33433-3
888-888-
8 888
123-456-
7 890
On Liberty
8
Mill
1
Big House
$25.00
0-321-
3 2132-1
321-321-
1 111
Small
House
714-000-
0 000
Balloon
13
Sleepy
3
$34.00
0-321-
3 2132-1
321-321-
2 222
Small
House
714-000-
0 000
Balloon
11
Snoopy
3
$34.00
0-321-
3 2132-1
321-321-
0 000
Small
House
714-000-
0 000
Balloon
12
Grumpy
3
$34.00
0-55-
1 23456-9
123-333-
3 333
Small
House
714-000-
0 000
Main Street
10
Jones
3
$22.95
0-55-
1 23456-9
123-222-
2 222
Small
House
714-000-
0 000
Main Street
9
Smith
3
$22.95
0-123-
4 5678-0
666-666-
6 666
Alpha Press 999-999-
9 999
Ulysses
6
Joyce
2
$34.00
1-22-
2 33700-0
444-444-
4 444
123-456-
7 890
Visual Basic 4
Roman
1
Big House
$25.00
LIBRARY_FLAT (Table 1-1) was created using Microsoft Word. For such a simple
database, Word has enough power to fulfill the two goals mentioned earlier. Certainly,
adding, deleting, and editing the table presents no particular problems (provided we know
how to manage tables in Word). In addition, if we want to sort the data by author, for
example, we can just select the table and choose Sort from the Table menu in Microsoft
Word. Extracting a portion of the data in the table (i.e., creating a view) can be done by
making a copy of the table and then deleting appropriate rows and/or columns.
1.1.1 Why Use a Relational-Database Design?
Thus, maintaining a simple, so-called flat database consisting of a single table does not
require much knowledge of database theory. On the other hand, most databases worth
maintaining are quite a bit more complicated than that. Real-life databases often have
hundreds of thousands or even millions of records, with data that is very intricately
related. This is where using a full-fledged relational-database program becomes essential.
Consider, for example, the Library of Congress, which has over 16 million topics in its
collection. For reasons that will become apparent soon, a single table simply will not do
for this database!
1.1.1.1 Redundancy
Using a single table to maintain a database leads to problems of unnecessary repetition of
data, that is, redundancy . Some repetition of data is always necessary, as we will see, but
the idea is to remove as much unnecessary repetition as possible.
The redundancy in the LIBRARY_FLAT table (Table 1-1) is obvious. For instance, the
name and phone number of Big House publishers is repeated six times in the table, and
Shakespeare's phone number is repeated thrice.
Search WWH ::




Custom Search