Best practice for aggregating logs for a given day and showing the sum

App
  • An app where people can record the beginning and end of an activity.
  • A table "time_plan" that saves date and duration. It represents how much time the user has on a given day.
  • A table "daily_task" that saves date, duration, and task. It represents how much time the user is willing to spend on which task on a given day.
  • A table view backed by `daily_task`, grouped by `date`.
What I Want

I would like to show a) the sum of durations of currently added daily tasks and b) how much more free time is left along with the daily tasks have been added. I only have a grouped list of the daily tasks.

What's the best way to structure the database for these sorts of aggregates?
Also, is there a way to show them altogether in the table view? (For instance, the aggregate in the header or footer).

0 1 89
1 REPLY 1

Something like - https://1minmanager.com/timesheets/   ?

Top Labels in this Space