There was a task to create an application for creating a list of tasks for a day \ week \ month.

It should be possible to add daily and weekly tasks.

Can you please tell us how to design a relational database more effectively in this situation? What entities should be highlighted?

Thank you in advance

Closed due to the fact that the issue is too general for the participants PashaPash , Vladyslav Matviienko , Kromster , Interface Unknown , Aries 22 Sep '15 at 5:00 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    Let's separate into separate entities Task statuses, Schedule types, Tasks, Executors, Task log. (Filling conditional, made for clarity)

     Task statuses Schedule types
     |  ID |  Name |  |  ID |  Name |
     | ---- | --------------- |  | ---- | -------- |
     |  1 |  On performance |  |  1 |  day |
     |  2 |  Completed |  |  2 |  week |
     |  3 |  Not done |
     |  4 |  Created |
     |  5 |  Submitted |  
     |  |  to another |
     |  |  performer | 
    
     Performers
     |  ID |  Name |
     | ---- | -------------- |
     |  1 |  Artist1 |
     |  2 |  Artist2 |
     |  3 |  Artist1 |
    

    We will also store tasks as a separate entity, so that the task itself can be separated from its state.

     Tasks
     |  ID |  Description |  View schedule |  Creation Date |  Artist |
     | ---- | ----------- | ---------------- | --------------- ------ | -------------- |
     |  1 |  Description1 |  1 |  01/01/2015 00:00:00 |  1 |
     |  2 |  Description2 |  1 |  01/01/2015 00:00:00 |  2 |
     |  3 |  Description3 |  2 |  01/01/2015 00:00:00 |  3 |
    

    We will store the changes in the task states in a separate table so that the chronology of the changes in the states and additional attributes can be tracked.

     Task Log
     |  ID |  Task |  Date |  Status | Artist |
     | ---- | -------- | --------------------- | -------- | ---- -------- |
     |  1 |  1 |  01/01/2015 00:00:00 |  4 |  |
     |  2 |  1 |  01/01/2015 01:00:00 |  1 |  |
     |  3 |  1 |  01/01/2015 02:00:00 |  5 |  2 |
     |  4 |  1 |  01/01/2015 02:00:00 |  2 |  |
    
    

      For example, one table for the "task" entity, with start_at, finish_at columns of datetime type. And another table associated with the "task", describing the "repeat" with fields such as daily, weekly, monthly.