Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/09/2005, 00:14
EsCoLtA
 
Fecha de Ingreso: agosto-2002
Mensajes: 134
Antigüedad: 22 años, 8 meses
Puntos: 0
Problema con las FK

Hola amig@s

Os paso un create de una tabla, pero me da error. Me dice que las FK estan mal definidas pero no se que hacer.

Código:
CREATE TABLE `dbequipos`.`equipos` (
  `pknumserie` VARCHAR(15) NOT NULL,
  `nombrepc` VARCHAR(10) NOT NULL,
  `marca` VARCHAR(10) NOT NULL,
  `funcion` VARCHAR(10) NOT NULL,
  `sistoper` VARCHAR(20) NOT NULL,
  `comentarios` VARCHAR(255) NOT NULL,
  PRIMARY KEY(`pknumserie`),
  CONSTRAINT `FKmarca` FOREIGN KEY `FKmarca` (`marca`)
    REFERENCES `marca` (`idmarca`),
  CONSTRAINT `FKfuncion` FOREIGN KEY `FKfuncion` (`funcion`)
    REFERENCES `funcion` (`idfuncion`),
  CONSTRAINT `FKso` FOREIGN KEY `FKso` (`sistoper`)
    REFERENCES `sistoper` (`idso`)
)
ENGINE = InnoDB;

Muchas gràcias.