Ver Mensaje Individual
  #8 (permalink)  
Antiguo 27/11/2009, 00:14
alx_salazar
 
Fecha de Ingreso: septiembre-2008
Mensajes: 192
Antigüedad: 15 años, 7 meses
Puntos: 1
Respuesta: aUXILIO!!!! Ayuda muy importante n se que le pasa a java con mysql

claro eso esta entendido, las relaciones de 1 a n, por favor mepuedes ayudar en esta tabla para ver como se hace? y corregirla por favor??

CREATE TABLE `libro` (
`cod_libro` int(10) unsigned NOT NULL auto_increment,
`nom_libro` varchar(45) NOT NULL,
`tema_libro` varchar(45) NOT NULL,
`desc_libro` varchar(400) default NULL,
`año_libro` varchar(45) default NULL,
`num_libro` varchar(4) NOT NULL,
`cod_autor` int(10) unsigned NOT NULL,
`cod_editorial` int(10) unsigned NOT NULL,
PRIMARY KEY (`cod_libro`),
KEY `FK_cod_autor` (`cod_autor`),
KEY `FK_cod_editorial` (`cod_editorial`),
CONSTRAINT `FK_cod_autor` FOREIGN KEY (`cod_libro`) REFERENCES `libro` (`cod_libro`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_cod_editorial` FOREIGN KEY (`cod_editorial`) REFERENCES `editorial` (`cod_editorial`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;