Compare
CREATE TABLE student
(
no int(50) NOT NULL,
name varchar(255),
gender varchar(10) check (gender in('female', 'male')),
age int(10),
d_no int(20) NOT NULL,
PRIMARY KEY (no),
FOREIGN KEY (d_no) REFERENCES dept(no)
);
which works, with
CREATE TABLE score
(
s_no int(40) NOT NULL,
c_no int(40) NOT NULL,
score int(40) NOT NULL,
FOREIGN KEY s_no REFERENCES student (no),
FOREIGN KEY c_no REFERENCES course (no)
);
which does not work. Spot the difference? Parentheses.
CREATE TABLE score
(
s_no int(40) NOT NULL,
c_no int(40) NOT NULL,
score int(40) NOT NULL,
FOREIGN KEY (s_no) REFERENCES student (no),
FOREIGN KEY (c_no) REFERENCES course (no)
);