Desmond, A primary key is needed to maintain a unique identity of each record and there by help in linking it to other records in other tables. However, we have certain tables which link one table to another (needed because of absence of foreign keys in mysql) which don't necessarily have primary keys. If you know that a column can have only unique records you are better off describing it as unique or primary key, not depending upon your code to always do that because there is a good chance that your code can have bugs and then all your data might turn out to be invalid. So the bottom line is that you don't *need* a primary key but if u know that a column will be unique then, do define it as unique or primary. Primary keys will certainly help in reducing redundant data as long as they have some meaning (Social security number, telephone number, etc).
Bhavin. ----- Original Message ----- From: "Desmond Lee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, July 27, 2002 7:26 PM Subject: help me out here guys... you gotta have a primary key > k.... > > This is seems ridiculous to me,.. but i'll let you tell me if i'm just being > stubborn. > > So, one of my associates has made a linking table (some people also call it > intersection table, cross tab table, but i believe that the propper way to > model a many to many relationship is via a "linking table"). in the linking > table, there is no primary key defined. I believe that every table must have > a primary key. It is absolutely essential, otherwise you'll get tons of > problems including redundancy, and inconsistency. However, my associate > believes that our coding will ensure that such problems will be avoided and > that it's okay for a table to have no primary key defined. I totally > disagree. Even if our code is perfect, a primary key must be defined. > > So, am i correct in being concerned, or am i just being close minded? > If, i'm totally wrong, in what situations is it a good idea, okay, or > benificial to not have a primary key defined for a table? > > > Thanks > > Desmond > > > (sql) > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > --------------------------------------------------------------------- > 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 > --------------------------------------------------------------------- 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