1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| DROP TABLE IF EXISTS SC_6; CREATE TABLE SC_6( SCno BIGINT, Sno BIGINT NOT NULL, Cno BIGINT NOT NULL, Grade INT NOT NULL, PRIMARY KEY(Sno, Cno) );
DROP TABLE IF EXISTS SC_7; CREATE TABLE SC_7( SCno BIGINT PRIMARY KEY AUTO_INCREMENT, Sno BIGINT NOT NULL, Cno BIGINT NOT NULL, Grade INT NOT NULL,
FOREIGN KEY(Sno, Cno) REFERENCES SC_6(Sno, Cno) );
|