外键参照完整性 [英] Foreign Key Referential Integrity
本文介绍了外键参照完整性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有四张桌子就是这样的,
Hi,
I have four tables which goes like this,
Customer(CustomerID INT, Name Varchar(10))
Supplier(SupplierID INT, Name Varchar(10))
Employee(EmployeeID INT, Name Varchar(10))
Address(AddressID INT, Street Varchar(10), City Varchar(10))
这里是客户,供应商和员工表每个都与Address表有一个外键关系。如何在Address表和其他表之间建立关系,以便保持参照完整性。
请帮助!!!
提前致谢
Here Customer, Supplier and Employee tables each will have a foreign key relationship with Address table. How do I build a relationship between Address table and others table so that I can maintain referential integrity.
Please help!!!
Thanks in advance
推荐答案
不确定我是否理解你的问题,但如果你正在寻找如何创建外键的语法,你可以查看以下链接
创建主键,外键和默认约束 [ ^ ]
Not sure if i understood your question correctly, but if you are looking for the syntax on how to create a foreign key you can check the below link
Creating Primary Key, Foreign Key and Default Constraint[^]
这篇关于外键参照完整性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文