Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi guys and girls,

have just started the book and come to my first question regarding some MySQL syntax - in relation to the 'KEY' index.
I understand what PRIMARY and UNIQUE keys are, however this is the first time i've come across the lone "KEY date_created (date_created)" syntax such as the code on page 51.

I also noticed it doesn't have to match i.e. 'KEY date_created (creation_date)'?

I've done quite a few searches on the net and even this forum but can't seem to find the answers or even hints.. normally for PHP i'd use the manual however the SQL manual doesn't seem to be anywhere near as friendly and all searches just bring up explanations of the UNIQUE or PRIMARY key syntax. 
Was hoping someone could point me in the direction of where to find out about this syntax?
Probably would be best if you could guide me to something as helpful as the PHP manual but for MySQL? 
when i search the MySQL site i get results returning to me in Chinese, which isn't my strongest language:)
thanks in advance for the guidance!

Link to comment
Share on other sites

"KEY" in this case is just a synonym for "INDEX", the most generic index type. 

 

When you create any index in MySQL, you have the option of giving the index a name. That can be (and often is) different than the columns being indexed. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...