开发者

oracle primary_key and foreign_key

开发者 https://www.devze.com 2022-12-30 20:07 出处:网络
Is it possible to maintain relationship bet开发者_JAVA技巧ween two tables without primary key and foreign key

Is it possible to maintain relationship bet开发者_JAVA技巧ween two tables without primary key and foreign key

if it is possible then how?


In a multi-user environment, you won't be able to maintain integrity (no orphan for example) without either foreign keys or a full TABLE LOCK on the child table. In other words, without foreign keys, you can't have both integrity and concurrency.


Yes, but it is highly inadvisable to do so. Any other solution you adopt will either perform less well, or be unreliable, or both.


Well, you could use a unique key for the parent table, you don't necessarily need to use the primary key :)

< /facetiousness >

0

精彩评论

暂无评论...
验证码 换一张
取 消