title: Employee table (Master and detail table)
body: <p>I am wondering if it is okay to have master and detail table for employees? </p>
  
  <p>As per requirments, data can filtered by department by country and by employee code on report level.</p>
  
  <p>If employee's department or country code is changed then the changes will go in detail table and old record will be set to IS_ACTIVE = 'T'.</p>
  
  <p>---------------------Master Table--------------------------------------</p>
  
  <pre><code>**EMPLOYEE_CODE**      VARCHAR2(20 BYTE)  NOT NULL, 
  EMAIL                  VARCHAR2(100 BYTE)
  FIRST_NAME             VARCHAR2(50 BYTE)
  LAST_NAME              VARCHAR2(50 BYTE)
  WORKING_HOURS          NUMBER
  </code></pre>
  
  <p>---------------------Detail Table--------------------------------------<br></p>
  
  <pre><code>**PK_USER_DETAIL_ID**     NUMBER,
  FK_EMPLOYEE_CODE          VARCHAR2(20 BYTE),
  FK_GROUP                  NUMBER,
  FK_DEPARTMENT_CODE        NUMBER,
  FK_EMPLOYER_COUNTRY_CODE  VARCHAR2(5 BYTE),
  FK_MANAGER_ID             VARCHAR2(20 BYTE),
  FK_ROLE_CODE              VARCHAR2(6 BYTE),
  START_DATE                DATE,
  END_DATE                  DATE,
  IS_ACTIVE                 VARCHAR2(1 BYTE),
  INACTIVE_DATE             DATE
  </code></pre>
  
  <hr>
  
  <p>Employee table will be linked with Timesheet table and for timesheet reports data can be filtered by department, country and by employee code.</p>
  
  <p><strong>OPTION : I</strong> </p>
  
  <ul>
  <li>Have one employee table with one Primary Key and create a new entry whenever department or role is updated for an employee. </li>
  <li>Add country and department code in the timesheet table.</li>
  </ul>
  
  <p>--> This way i don't need to search employee table. </p>
  
  <p><strong>OPTION : II</strong> </p>
  
  <ul>
  <li>Have master and detail table. </li>
  <li>Add country and department code in timesheet table.</li>
  </ul>
  
  <p>--> This way i don't need to search employee table plus i will have master detail table</p>
  
  <p><strong>OPTION : NEW</strong> </p>
  
  <ul>
  <li>Have master and detail table. </li>
  <li>Timesheet table will have EmpCode.</li>
  <li>If user move to new <em>location</em> or <em>change department</em> then Insert a new row in the detail table with the new dept Code and same Emp No.</li>
  <li>Update an old row and set the End Date field so if he changes his location or department then the End Date field needs to be updated.  </li>
  </ul>
  
  <p>Which one is a best option and is there any other better option available?</p>