Topic awaiting preservation: When don't I need the primary key of table??? (Page 1 of 1) |
|
---|---|
Neurotic (0) Inmate Newly admitted From: |
posted 08-12-2004 03:39
Hi, guys. May I ask you something, please? |
Maniac (V) Inmate From: few miles outside philly |
posted 08-12-2004 04:54
You wouldn't need a primary key if the table exsist by itself and/or if it is never referenced or shared data from another table. |
Obsessive-Compulsive (I) Inmate From: |
posted 08-12-2004 06:15
Hi, Mal. Thanks for that. quote:
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-12-2004 06:21
Primary keys are unique identifiers for a row in the table. If you don't have one, when you do a join you don't have a unique way of identifying a particular row in the table. |
Obsessive-Compulsive (I) Inmate From: |
posted 08-12-2004 07:00
Thanks a lot but let me say a wee bit more, BD. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 08-12-2004 14:14
The absolute unique data is what you would declair the primary key. |
Maniac (V) Inmate From: few miles outside philly |
posted 08-12-2004 20:11
Wow... I just had my DB class last semester. I wish you had the teacher I did. He pounded all this info into us and the book that went along with it was great. Before you start rambling off questions and expecting easy answers, can I ask if you have sat down and read a book yourself about relational databases. This may be your best solution and provide answers in a more orderly fashion. I don't mean to say this to be rude but I don't want to give you my few thousand dollars in education in a few threads. If I had to suffer for 6+ months to learn this then you should at least do some reading before taking the easy way out. Or at least tell me a specific issue where this is coming up for you. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 08-12-2004 21:39
You don't need primary keys, you want primary keys. They are the identifiers used to make a row in a table unique. When you do a join you are going to get a SQL result set with a number of rows. Without using a primary key there's nothing to distinguish the rows so you're just going to have a chunk of data that you can't really do much with. |