CREATE TABLE students(
student_id int(11) NOT NULL AUTO_INCREMENT,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
advisor_id int(11) DEFAULT NULL,
PRIMARY KEY (student_id),
KEY advisor_id (advisor_id),
CONSTRAINT FOREIGN KEY (advisor_id) REFERENCES advisors (advisor_id)
);
答案 0 :(得分:-1)
CONSTRAINT (advisor_id) FOREIGN KEY REFERENCES advisors (advisor_id)