——添加外键约束

语法:
alter table 表1-表名
add constraint 外键名称(一般外键名称为”fK_”开头) foreign key (要设为外键的列名)
references 表2-表名(与哪个表有关联) (表2中该列列名);

alter table T_Result
add constraint fk_studentId2 foreign key (studentId)
references T_Student (studentId);

alter table t_CardInfo
add constraint fk_customerID foreign key(customerid)
references T_UserInfo (customerid);

相关文章:

  • 2021-10-01
  • 2021-10-23
  • 2022-12-23
  • 2021-03-30
  • 2021-11-09
  • 2021-07-17
  • 2022-12-23
  • 2021-12-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-01
  • 2021-12-27
相关资源
相似解决方案