![]() |
|
|
#1 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Is a primary key ALWAYS required?
I have a bunch of tables right now where I can't think of a single reason to add a primary key yet phpmyadmin wants me to. I only use the tables for one thing and they are doing that thing well.
|
|
|
|
|
|
#2 |
|
Member
Join Date: Feb 2005
Location: ANtwerp - Belgium
Posts: 34
|
Re: Is a primary key ALWAYS required?
The only reason I can think of to identify a unique key is that you must be
able to identify one single record. If you do not add a unique key, you might create tables where you could not single out one row only. In cases where you cannot image a unique key, just add a number and make it a unique key. |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
Re: Is a primary key ALWAYS required?
IMHO, It all depends on how the table will be used and how it will be referenced. Could you give an example of how these tables are structured.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jul 2004
Posts: 167
|
Re: Is a primary key ALWAYS required?
As a once-only filled in lookup table. No need to update or change the tables ever. (and even if I would need to, a simple if statement would allow access to a record). For example, B=Blue. R=Red. P=pink. Select would provide the shortcut, and return the long name.
__________________
** Most misspellings intentional to combat spaham filterz** |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2006
Posts: 5
|
Re: Is a primary key ALWAYS required?
Then I would probably not add a Primary Key.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Table with text and numeric primary keys | AJLaFrance | Database Design | 1 | 01-28-2005 10:55 AM |
| MySQL/php assistance required...Please! | peevee | General | 0 | 09-10-2004 11:20 AM |
| MYSQL Help Required | acidbath | General | 3 | 09-08-2004 10:27 AM |
| 1.8 MySQL Standards Compliance | Administrator | Documentation | 21 | 06-08-2004 03:18 AM |