Database Reference
In-Depth Information
that album names and dates are always entered in order and not changed
afterward?
There are two ways to eliminate the problem of the repeating group.
First, we could add new attributes to handle the additional albums, as in
Table 4.2.
Table 4.2
Artists and Albums: Eliminate the Repeating Group, but at What Cost?
Artist
Album
Release
Album
Release
Name
Genre
Name 1
Date 1
Name 2
Date 2
The Awkward
Rock
Home
10/01/2006
NULL
NULL
Stage
Girth
Metal
On the Sea
5/25/1997
NULL
NULL
Wasabi
Adult
Spicy
11/12/2005
NULL
NULL
Peanuts
Contemporary
Legumes
Rock
The Bobby
R&B
Running
7/27/1985
Live!
10/30/1988
Jenkins Band
the Game
Juices of Brazil
Latin Jazz
Long Road
1/01/2003
White
6/10/2005
We've solved the problem of the repeating group, and because no at-
tribute contains more than one value, this table is in 1NF. However, we've
introduced a much bigger problem: what if an artist has more than two al-
bums? Do we keep adding two attributes for each album that any artist re-
leases? In addition to the obvious problem of adding attributes to the
entity, in the physical implementation we are wasting a great deal of space
for each artist who has only one album. Also, querying the resultant table
for album names would require searching every album name column,
something that is very inefficient.
If this is the wrong way, what's the right way? Take a look at Tables 4.3
and 4.4.
Table 4.3
The Artists
ArtistName
Genre
The Awkward Stage
Rock
Girth
Metal
Wasabi Peanuts
Adult Contemporary Rock
The Bobby Jenkins Band
R&B
Juices of Brazil
Latin Jazz
Search WWH ::




Custom Search