SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Please help me with this table design

    Hello

    * my HR manager will create tasks and assign to one or more employees
    * Tasks has a dead line. ex : 5 days
    * so when a task is assigned to employee(s), during the task execution period, those employees will keep adding status updates, so HR manager can see what is going on with a given task.

    Table tasks

    task_id (AI) | task | assigned | deadline
    --------------------------------------
    10 | take vehicle stocks | 10/12/2012 | 16/12/2012
    11 | prepare time sheets | 12/12/2012 | 17/12/2012

    Table status_updates

    status_id (AI) | status | added_on | by (empno)
    ---------------------------------------
    16 | just started with the yard A | 12/12/2012 | 2340
    17 | 200 vehicles finished in yard A | 13/12/2012 | 2340

    now when a comment is added to a task, where can i link that status with the particulate task?
    should i add another column in status_updates table as task_id ?

    so it will be

    task_id | status_id (AI) | status | added_on | by (empno)
    ---------------------------------------
    10 | 16 | just started with the yard A | 12/12/2012 | 2340
    10 | 17 | 200 vehicles finished in yard A | 13/12/2012 | 2340

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Location
    OH, USA
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you need 3 tables

    tasks like you have
    task_id, task, assigned, deadline

    TaskEmployee
    task_id, EmployeeId

    and Status_updates
    ststus_id,task_Id, status, Added_on,EmployeeId

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,182
    Mentioned
    67 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by gk53 View Post
    I think you need 3 tables

    tasks like you have
    task_id, task, assigned, deadline

    TaskEmployee
    task_id, EmployeeId

    and Status_updates
    ststus_id,task_Id, status, Added_on,EmployeeId
    +1


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •