views:

32

answers:

1

I have a unary relationship. (Image Url : http://freezpic.com/pics/666c94955212a2f757fa25f9f7d31a5e.png) But I want define a table for person. The table has personID and personName column. What columns add it?

A: 

If I get this right, you are trying to define a unary relationship of Person-Manager. Unary are usually modeled the same way as binary relationship. In this case, you need a foreign key to associate a Person with the person managing them.

You could define this in a single table. In the Persons table, add a column called ManagerId. This will be your foreign key field; representing the id (personId) of the manager.

Pran
watch out for the case when a person has more than one manager - or you want to model additional personal relationships. in these cases, you would want another table.
Randy