At 3:14 AM -0700 5/6/09, Michael A. Peters wrote:
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
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
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).
But for a database, a book identifier would probably be best
(differing opinions on this) if it was simply an auto_increment
unsigned integer primary key. A key that is generated upon entry of a
Certainly one can argue that using a different unique key might
provide more information and make the table require one less field,
but if one uses a primary key, then the field can be searched faster
than using a ISBN or L.O.C., which may be duplicated, amended, or not
even present. My thinking on this is a unique identifier for the book
should not be tied to any attribute of the book, which may change,
but rather something completely detached and artificial.
http://sperling.com http://ancientstones.com http://earthstones.com
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php