Data base planning advice?

Not quite sure how to go about this.
would like to create a site to help track time and tasks.
so if user b works 5 hours in writing, 3 reading and 2 explaining
he can go to a page. select his/her name.
that will take him to page where they can select to enter those times. And the they should be totaled.
also i would want to set the hours & mintues to zero. as they would need to be entered?
am already planning one table with a:

id (primary)
first name
last name
email.
a second table for the activities:

reading
writing
explaining

but for the hours and minutes and a date field
should that be in a third table or can it be in the second table?
What would be the best way to do this. is there a great tutorial out there? looked for a few and doing a php revw right now.
thx
D

The second table would have one column for the id from the first table, one for the activity, one for the date and one for the amount of time.

You can either make the key for the second table the firt three columns and just accept the total time or make the key the first two columns and allow multiple times to be entered for the same day.

I’m going to quote my own post from… 4 years ago, about designing a database;

A User is an entity. An activity is an entity [You can choose to have activities as a separate table if you want, but the table is going to be fairly small, as there is little information inherent to an activity from your description.]
A user has many properties. [An activity only has one intrinsic property - a name.]
A user performs an activity. This represents a relationship between them of a many-to-many variety, which [in the advanced implications of step 3] suggests there is a table to be had between the two. (this would be the second table felgall refers to)

1 Like

Thank all, Yep i got that far.
but was wondering about the time. as in the hours & minutes.
should they be relational to the tasks and have their own table or can they be in the same table and I am just over complicating?
also planning on making them into decimal fields.

Time Performed is a property of the performed activity. It would be a part of the second table. (“A user performs a certain activity for a certain amount of time on a certain day.”)

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