# Structure of a database

**URL:** <https://community.thunkable.com/t/structure-of-a-database/1637719>\
**Category:** Questions about Thunkable X\
**Created:** [November 28, 2021, 8:20pm UTC](https://community.thunkable.com/t/structure-of-a-database/1637719 "2021-11-28T20:20:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [November 28, 2021, 8:20pm UTC](https://community.thunkable.com/t/structure-of-a-database/1637719/1 "2021-11-28T20:20:25Z")

</div>

hi

 ![Capture d’écran 2021-11-28 à 07.51.10](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/854fcc8c756ddc1ef63633a73f23f143346d24b4.png)  
this database structure above allows me to follow the execution time of tasks by a set of freelancers  
is it really suitable?  
if I want to add up the time spent by each freelancer I have to survey each date can be in vain?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 28, 2021, 9:21pm UTC](https://community.thunkable.com/t/structure-of-a-database/1637719/2 "2021-11-28T21:21:40Z")

</div>

Why not add the duration.

Now you have `start` and `end`, so before you save them, calculate the duration and store it with the other two. so for each entry you will have:

- start
- end
- duration

When you want to see the total time spent, only add the `duration` for each entry.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [November 28, 2021, 11:24pm UTC](https://community.thunkable.com/t/structure-of-a-database/1637719/3 "2021-11-28T23:24:44Z")

</div>

You could even save a list of just durations if that’s easier. Or, when adding a new time, add the duration to a running total for the user perhaps?

Depends on the use case as to a `best solution.`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [February 26, 2022, 11:24pm UTC](https://community.thunkable.com/t/structure-of-a-database/1637719/4 "2022-02-26T23:24:50Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
