Member Avatar for arcticM

in this code-

CREATE TABLE `tablename` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `a` varchar(10) NOT NULL,
  `b` varchar(45) default NULL,
  `c` varchar(45) NOT NULL,
  `d` varchar(45) default NULL,

  PRIMARY KEY  (`id`),
  KEY `Index_a` (`a`),
  KEY `Index_bcd` (`b`,`c`,`d`),
  KEY `Index_cd` (`c`,`d`)
) ....;

what do the lines that start with KEY?
I know PRIMARY KEY sets the pk of the table.. but I don't understand the rest of the lines..
does that have to do something with setting indexes to make searches faster? or something like that?

Recommended Answers

All 2 Replies

indexs help us to do retrival from database in efficient way

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.