1

Situation: Employee Registration System where every employee must have a branch and each branch must have a branch manager. (sorry for Diagram I don't have proper tool)

enter image description here

Table Employee
[ID].... [Branch_ID]

Table Branch
[ID].... [Manager] (ID of employee who manages)

Question: What would be the best way to handle this situation just check for the first employee or remove the manger mandatory check of manager ? Or any other way ? Any help would be appreciated.

Raging Bull
  • 18,593
  • 13
  • 50
  • 55
Fahad
  • 43
  • 1
  • 4
  • can you please show some samples from your tables and the result which you want? – Hamidreza Mar 04 '14 at 06:47
  • Bro I just need suggestion like when I try to register Employee Emp1 who works in Br1. In this situation, I need to register Br1 first but when if I register Branch Br1 first there I need an employee (We can say he is) E1. This is like a never ending loop. For every new entry of employee of new Branch this problem will occur so I am asking what would be the best solution to keep check from front end forms(entry forms) where user can register branch without manager and then update later or is there any other better way. – Fahad Mar 04 '14 at 07:04

1 Answers1

0

You just need to remove mandatory check of having branch manager while inserting new branch in your database.If you have any foreign key relationships find way to insert NULL value in foreign key column.

AK47
  • 3,707
  • 3
  • 17
  • 36