[NCLUG] normalizing data

Michael Dwyer mdwyer at sixthdimension.com
Mon Jan 7 10:27:25 MST 2002


mike cullerton wrote:
>  i have a database with info about some images. every image has a name and
> location (directory path). some images have comments associated with them
> (ultimately, all should) and each image can be the member of one or more
> groups.

You know, the sad thing is that I took one look at this post and
thought, "Mike's building a PORN SERVER!!"

For what it is worth, the whole point of normalization seems to be to
minimize duplication.  So if comments are, indeed, the same between
photos, it is probably best to have them in a separate table.  I'm not
sure of the performance changes that would entail, but if nothing else,
it would allow you to do

  SELECT * FROM photos WHERE commentID="14";

and reliably find all photos with the same comment.  You could also have
another "subject" table:

  SUBJECT
  int subjectid
  char(50) subject
  --- --------
   1  Flowers
   2  Cars
   3  Porn
   4  Animals
   5  Family
   6  etc



More information about the NCLUG mailing list