MySqlTalk.com  

Go Back   MySqlTalk.com > MySQL > Database Design
User Name
Password
FAQ Members List Calendar Search Today's Posts Mark Forums Read


Reply
 
Thread Tools Search this Thread
Old 02-06-2005, 04:21 PM   #1
Azkaban
Senior Member
 
Join Date: Jul 2004
Posts: 167 Azkaban is on a distinguished road
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.
Azkaban is offline   Fork this post Reply With Quote
Old 02-25-2005, 02:39 PM   #2
gertcuppens
Member
 
Join Date: Feb 2005
Location: ANtwerp - Belgium
Posts: 34 gertcuppens is on a distinguished road
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.
gertcuppens is offline   Fork this post Reply With Quote
Old 02-21-2006, 05:17 PM   #3
jstephens
Junior Member
 
Join Date: Feb 2006
Posts: 5 jstephens is on a distinguished road
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.
jstephens is offline   Fork this post Reply With Quote
Old 02-23-2006, 11:22 AM   #4
Azkaban
Senior Member
 
Join Date: Jul 2004
Posts: 167 Azkaban is on a distinguished road
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**
Azkaban is offline   Fork this post Reply With Quote
Old 02-23-2006, 11:42 PM   #5
jstephens
Junior Member
 
Join Date: Feb 2006
Posts: 5 jstephens is on a distinguished road
Re: Is a primary key ALWAYS required?

Then I would probably not add a Primary Key.
jstephens is offline   Fork this post Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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



All times are GMT -4. The time now is 01:30 PM.



Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Google
  Web http://www.mysqltalk.com
DISCLAIMERS:
1. We have no commercial interest in this site.
Banner Ads and Subscriptions will only be used to help pay for hosting and maintenance costs.
2. MySQLTalk.com is NOT affiliated with MySQL AB in any way.
3. MySQLTalk.com is NOT endorsed by MySQL AB in any way.
4. Please do not post any content that is harmful to MySQL or MySQL AB, meaning no misleading or obsolete information will be tolerated.
Well-founded constructive criticism meant to help the community is permitted.
5. This website is founded with the goal of improving the MySQL community.
We not only tolerate newbies, we encourage them.
Please do not ask newbies to "read the manual".