CREATE TABLE S
(SID INT(4) NOT NULL,
NAME VARCHAR(50) NOT NULL,
AGE SMALLINT,
SEX CHAR(1),
PRIMARY KEY(SID));
CHEATE TABLE SE
(SID INT(4),
CID INT(4),
SCORE SMALLINT,
PRIMARY KEY(SID,CID),
FOREIGN KEY (SID) REFERENCES S (SID),
FOREIGN KEY (CID) REFERENCES C (CID));
表名
主键
外键