mysql - Statement containing indexes, keys and comments with auto_increment -


i came across following sql in book. understand parts declaring basics types.

create table if not exists `content` (   `id` int(11) not null auto_increment,   `current_revision` int(11) not null,   `active` tinyint(1) not null,   `secure` tinyint(1) not null,   `parent` int(11) not null,   `order` int(11) not null,   `author` int(11) not null,   `type` int(11) not null,   `path` varchar(255) not null,   primary key (`id`),   key `current_revision` (`current_revision`,`active`,`type`),   key `type` (`type`),   key `author` (`author`) ) engine=innodb  default charset=latin1 comment='content elements table' auto_increment=4 ; 

the following not understood:

  key `current_revision` (`current_revision`,`active`,`type`),   key `type` (`type`),   key `author` (`author`) 

i know "key" keyword same "index" way is used here unfamiliar me. multiple entries this:

key `current_revision` (`current_revision`,`active`,`type`) 

lastly line don't know about:

engine=innodb  default charset=latin1 comment='content elements table' auto_increment=4; 

i take here telling engine store table , charset use, along comment. comment stored , "auto_increment=4" doing way tail end?

you can think keys index. between parenthesis column names index refers to. auto_increment=4 means sets auto_increment @ value 4, first inserted records begin @ stage 4. innodb 1 of plenty database engines, you'll find docs everywhere ;) here's some, choice of engine depends on need !


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -