任何人都可以从我的代码中看到为什么我收到此错误?这对我来说是新的,所以还在学习。感谢
CREATE TABLE DIRECTOR(
DIRECTOR_ID VARCHAR (6) PRIMARY KEY NOT NULL,
F_NAME VARCHAR (10) NOT NULL,
L_NAME VARCHAR (10) NOT NULL);
CREATE TABLE TITLE_DIRECTOR(
TITLE_ID VARCHAR (10) NOT NULL,
DIRECTOR_ID VARCHAR (6) NOT NULL,
TITLE_NAME VARCHAR (50) NOT NULL,
DIRECTOR_FNAME VARCHAR (10) NOT NULL,
DIRECTOR_LNAME VARCHAR (10) NOT NULL,
INDEX (DIRECTOR_ID),
FOREIGN KEY (DIRECTOR_ID) REFERENCES DIRECTOR (DIRECTOR_ID));
答案 0 :(得分:0)
也许您将MyISAM作为默认引擎,只需将隐式引擎放入InnoDB:
CREATE TABLE DIRECTOR(
DIRECTOR_ID VARCHAR (6) PRIMARY KEY NOT NULL,
F_NAME VARCHAR (10) NOT NULL,
L_NAME VARCHAR (10) NOT NULL
) ENGINE = InnoDB;
CREATE TABLE TITLE_DIRECTOR(
TITLE_ID VARCHAR (10) NOT NULL,
DIRECTOR_ID VARCHAR (6) NOT NULL,
TITLE_NAME VARCHAR (50) NOT NULL,
DIRECTOR_FNAME VARCHAR (10) NOT NULL,
DIRECTOR_LNAME VARCHAR (10) NOT NULL,
INDEX (DIRECTOR_ID),
FOREIGN KEY (DIRECTOR_ID) REFERENCES DIRECTOR (DIRECTOR_ID)
)ENGINE = InnoDB;;