有两个表
第一个是game表
CREATE TABLE game(
gameID INT(1),
gameDate DATETIME,
gameLocation VARCHAR(20),
opponent VARCHAR(20),
PRIMARY KEY (gameID)
) ENGINE = MYISAM AUTO_INCREMENT = 5 DEFAULT CHARSET = utf8;
第二个是tactics表,需要与game中的gameID外键连接
CREATE TABLE tactics(
tacticsNumber INT(2),
gameID INT(1),
tacticsName VARCHAR(10) NOT NULL,
PRIMARY KEY (tacticsNumber),
-- 建立外键,关联到game表
CONSTRAINT fkGameTactics FOREIGN KEY (gameID) REFERENCES game(gameID)
);
显示fail to open the referenced table ‘game’,求解?