• PHP Help
  • Database Design for task monitoring system

I am designing the database table structure for the task monitoring system. I have a situation where each user can assign tasks to each other. For example, user A assigns a task to user B. User B can assign tasks to user C and so on.
I have designed the following tables and their columns

  1. users table - stores all users of the system
UserId - int - Primary key- auto increment
Full Name - varchar
Email - varchar
username - varchar
password - varchar
  1. tasks table - stores the tasks for each user
TaskId - int - primary key -auto increment
CreatedBy - int - foreign key - (UserId of users table)
AssignedTo - int - foreign key (UserId of users table)
TaskName - varchar
TaskDescrition - varchar
StartDate - date
EndDate - date
Status - varchar

Is this table design correct for storing the task details created by one user to another?

    Looks reasonable to me, with the exception that I might consider creating a task_status table with set of possible statuses, then make the Status column in the tasks table be a foreign key to it.

    NogDog
    Thanks, as I am not going to store or record the status change for the task, so it it ok if I store the status in the task table itself. Will it cause any exception or errors.

    Account Will it cause any exception or errors.

    It will prevent you from controlling what gets put in that field: COMPLETE, 50% half, Waiting on J—...

      Write a Reply...