同标题,急切地问

解决方案 »

  1.   

    SQL> create table t1(x int primary key);表已创建。SQL> create table t2(y int primary key);表已创建。SQL> create table t(x int CONSTRAINT fk_x references t1,y int CONSTRAINT fk_y references t2);表已创建。
      

  2.   

    同一个表的同一个字段的外键只能来自一个表
    同一个表的不同字段的外键可以来自多外表
    alter table 表A add constraint FK_B foreign key (ticket_no) references 表B(ticket_no)
    alter table 表A add constraint FK_C foreign key (person_no) references 表C(person_no)