I have the next SQL query:
DROP TABLE IF EXISTS `Genre_Movie`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `Genre_Movie` (
`id_genre` int(11) NOT NULL DEFAULT '0',
`id_movie` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_movie`,`id_genre`),
KEY `id_genre` (`id_genre`),
CONSTRAINT `Genre_Movie_ibfk_1` FOREIGN KEY (`id_movie`) REFERENCES `Movie` (`id_movie`),
CONSTRAINT `Genre_Movie_ibfk_2` FOREIGN KEY (`id_genre`) REFERENCES `Genre` (`id_genre`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
But I don't really know what does the following line does:
KEY `id_genre` (`id_genre`),
Can someone explain me what is the use of this line, creating a key that is not Foreign or Primary? Thanks.