Re: Mr. Stuckle and Mr. Miller - explain normalisation with an example [message #185300 is a reply to message #185293] |
Mon, 17 March 2014 04:17 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Sun, 16 Mar 2014 21:43:35 -0400, richard wrote:
> I defend my use of this table by the fact that it is merely for
> recordkeeping reasons.
This is part of the fundamental problem.
You're duplicating data that is held elsewhere in the database in the new
table.
You shouldn't be creating tables based on the functions for which they're
being used, you should be designing tables according to data which is
being held in the whole database, normalised in such a way that the
attributes of an object are all stored in one place associated with that
object, and the links between objects are defined by the relationships.
In this case, you describe a table that contains:
songid, hits, title, author, license
However I'm sure you already have at least one (and possibly ten) table
(s) that link songid / title / author, because I suspect that you have
those columns in each of the 1960, 1961, 1962 .... 1969 tables.
So why are you duplicating that data in yet another table, and how are
you going to ensure data consistency is maintained between the 10 year
tables and the hits table (and by hits I assume you mean the number of
plays that is recorded)?
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|