homepage Welcome to WebmasterWorld Guest from 54.161.246.212
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

    
MySQL: Primar y key, index, unique
what is what?
dr_paul

5+ Year Member



 
Msg#: 3605168 posted 11:52 am on Mar 19, 2008 (gmt 0)

In MySQL - what is a "primary keys"?

Is it one column in a table?
Can it be more than one column?
Is it the same as an Index?
Does a table HAVE to have a primary key?

 

badone

5+ Year Member



 
Msg#: 3605168 posted 9:04 am on Mar 24, 2008 (gmt 0)

Is it one column in a table?

It can be one or more.

Is it the same as an Index?

No, a primary key uniquely identifies each individual row in a table. An index improves the speed of operations on a table, it can also be on one or more columns.

Does a table HAVE to have a primary key?

No, but it is good practice IMHO.

Cheers,
badone

dr_paul

5+ Year Member



 
Msg#: 3605168 posted 9:20 am on Mar 24, 2008 (gmt 0)

Thanks for posting, bad one - and thanks for your straight answers. Kudos.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved