> > Disclaimer: SQL/database newbie here. > > Nothing wrong with being a newbie :-)
Thanks for the help. > > Let's say I have a table of authors with columns for last name and first > > name. Is there any general guideline re using a separate > integer for the > > primary key as opposed to a combination of the last and first > names as the > > key? I ask because by using the names, this would prevent > > duplicate entries > > into the db, right? Whereas using a separate integer key would > > not prevent > > this--you'd have to search for the author to see if it was > > already in the db > > before inserting to avoid dupes, right? [snip useful info] > > BTW, there's nothing to stop you from adding another > unique index besides the primary. See the CREATE TABLE / > ALTER TABLE commands in the manual. This would prevent > you from inserting any duplicates. > > / Carsten > -- > Carsten H. Pedersen > keeper and maintainer of the bitbybit.dk MySQL FAQ > http://www.bitbybit.dk/mysqlfaq This begs the newbie question of what, in a nutshell, happens on an insert? Perhaps too newbie for this forum, but I thought I'd ask. I am ignorant of indexes etc, so I guess I only considered the primary key being checked for a dupe during an insert. Thanks, Chris --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php