> that is, that if the values for the field 'table1.people_id' rows is > "1" - "50", then the field values for 'table2.location_id' (or any > other table) cannot also be "1" - "50".
I think you're mis-interpreting the use of "values." While the actual value can be the same between the fields (1, 11, 40, etc.), what it signifies must differ. THe important thing is that the two keys are in no way dependant on anything else in the database. Here's an example. Say you're developing a catalogue of books. The database needs at least two tables: books and authors. Each of them will have an id field (book_id, author_id) to be used as the primary key. (In addition, the books table will have an author_id field as a foreign key, but this is a discussion for later). If you have 50 books in your DB with 25 different authors, there will inevitably be some overlap in the id field values. However, because neither field is directly linked to the other, this is not an issue. I apologise if this isn't the best explanation. I'm one of the world's worst teachers, and the fact that it's nearly 05:00 isn't helping that. Edward Dudlik Becoming Digital www.becomingdigital.com ----- Original Message ----- From: <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Sent: Thursday, 29 May, 2003 15:19 Subject: database newbie Ok, since this is THE place for MySQL and related discussion/questions, here goes: I'm trying to understand Keys, I do for the most part, but in reading the well recommended book 'Database Design for Mere Mortals' I got a bit confused. A check for worthy primary key designation is to ask what fields are "indirectly" identified by the PK, then the book says to slash such a field --I suppose later to put it into a separate or subset table; however, turning the page, the field is there and never removed from the final version of the book's example table. (If you have this book it is Chap. 8, pgs. 224-226.) Next, again from reading this book, I am told that when i create Primary Keys manually (or artificially, i.e., not naturally occurring fields) e.g., making a field called 'table1.people_id' as my Primary Key (auto-incrementing), and in another table the Primary Key 'table2.location_id' (auto-incrementing), the book leads me to believe that each of these *two table's Primary Key's field values cannot be the same*. that is, that if the values for the field 'table1.people_id' rows is "1" - "50", then the field values for 'table2.location_id' (or any other table) cannot also be "1" - "50". Huh??? Is that long winded stuff I just wrote simply wrong? (I think it is, but need clarity.) *If it is correct, then how is such a thing accomplished? Thanks. Ted -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]