5,888
社区成员
发帖
与我相关
我的任务
分享drop table contest2;
CREATE TABLE A3WASIN1.CONTEST1
(TEST_ID SMALLINT NOT NULL
);
Insert into CONTEST1(test_id) values(1);
Insert into CONTEST1(test_id) values(2);
Create table CONTEST2 like contest1;
Insert into CONTEST2(test_id) values(1);
Insert into CONTEST2(test_id) values(2);
Alter table contest2 add constraint test_id_pri primary key(test_id);
Alter table contest1
Add constraint IF_TEST foreign key
(
test_id
) references contest2(test_id);