views:

38

answers:

3

Is it possible to maintain relationship between two tables without primary key and foreign key

if it is possible then how?

+2  A: 

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

Tony Andrews
+4  A: 

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.

Vincent Malgrat
A: 

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

< /facetiousness >

Jeffrey Kemp