Re: How to deal with identical fields in db

From: Date: Wed, 06 May 2009 10:14:40 +0000
Subject: Re: How to deal with identical fields in db
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-292330@lists.php.net to get a copy of this message
Peter Ford wrote:
tedd wrote: (and I added in some extra bits...)
You need to normalize. Authors should have an unique id in an authors table. The authors table has all the specific information about authors, but not the books they have written. Books should have an unique id in a books table. The books table has all the specific information about books, but not the contributing authors.
Like the ISBN, for example - that should be unique enough for anyone... I suppose if you deal in antique books, there might not be an ISBN.
Unfortunately sometimes an otherwise identical but different printing of the same book has different ISBN numbers. Sometimes the difference is hardback vs softcover, special edition, or just a reprint. The L.O.C. catalog number may be better, AFAIK there is typically only one LOC number per edition of a book. It is a good idea to record both (if both exist) and use an internally assigned substitute number when one, the other, or both don't exist (small run self published works often don't have a LOC number for example, if the author didn't want to pay for it).

« previous php.general (#292330) next »