1 Replies - 3335 Views - Last Post: 24 August 2012 - 10:39 AM

#1 rnty  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 145
  • Joined: 14-August 12

column dependency in the same table

Posted 17 August 2012 - 08:02 AM

I have a table called employee.It has 7 attributes/columns.Two of its columns are empid and managerid.When I am creating the table I must ensure that managerid is in empid.How do I enforce such a constraint?
Thank you
Is This A Good Question/Topic? 0
  • +

Replies To: column dependency in the same table

#2 rnty  Icon User is offline

  • D.I.C Head

Reputation: 20
  • View blog
  • Posts: 145
  • Joined: 14-August 12

Re: column dependency in the same table

Posted 24 August 2012 - 10:39 AM

I got the answer.We can do so by making the other column a foreign key references the primary key of the same table.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1