J
JMF
Here is an absolutely minimal spec for my little time management system:
1) A set of projects. Each project has a set of tasks.
2) Every day, I make a number of entries: "I worked x hours today on task y
of project z. I worked n hours on task q of project r." etc. whereby there
could be any number of entries on a single day, depending on how long you
worked on how many different tasks.
That's it. Simple as that.
Since I'm pretty new to Access, I want to be sure I get the table design
correctly. This is what I currently have:
Table "Projects." Just one field, projects, which is the primary key.
Project1
Project2
etc.
Table "Tasks." TaskId, Project, Task. TaskId is the primary key, Project is
linked to the foreign key in the projects table.
1 Project1 Task1
2 Project1 Task2
3 Project2 Task1
etc.
Table "Hours Worked." Date, Hours, TaskId, whereby TaskId is linked to the
TaskId in the Tasks table.
5 Feb 2006, 3 hours, TaskId = 1
5 Feb 2006, 2 hours, TaskId = 3
etc.
How does that seem as a minimal but adequate design? Here are a couple of
questions:
- It seems to me that in the Tasks table, you could even do away with the
TaskId field and directly use the combination of Project and Task as the
primary key, since the combination has to be unique. But then I don't
understand how that would fit in to a relationship to the Hours Worked
table. Is it possible or desirable to eliminate the TaskId primary key? Or
is it the best way to relate those two tables?
- Currently my Hours Worked table has no primary key, which makes me
nervous. On the other hand, I can't figure out what it would be good for if
I had it.
Any table design experts interested in commenting?
Thanks!
John
1) A set of projects. Each project has a set of tasks.
2) Every day, I make a number of entries: "I worked x hours today on task y
of project z. I worked n hours on task q of project r." etc. whereby there
could be any number of entries on a single day, depending on how long you
worked on how many different tasks.
That's it. Simple as that.
Since I'm pretty new to Access, I want to be sure I get the table design
correctly. This is what I currently have:
Table "Projects." Just one field, projects, which is the primary key.
Project1
Project2
etc.
Table "Tasks." TaskId, Project, Task. TaskId is the primary key, Project is
linked to the foreign key in the projects table.
1 Project1 Task1
2 Project1 Task2
3 Project2 Task1
etc.
Table "Hours Worked." Date, Hours, TaskId, whereby TaskId is linked to the
TaskId in the Tasks table.
5 Feb 2006, 3 hours, TaskId = 1
5 Feb 2006, 2 hours, TaskId = 3
etc.
How does that seem as a minimal but adequate design? Here are a couple of
questions:
- It seems to me that in the Tasks table, you could even do away with the
TaskId field and directly use the combination of Project and Task as the
primary key, since the combination has to be unique. But then I don't
understand how that would fit in to a relationship to the Hours Worked
table. Is it possible or desirable to eliminate the TaskId primary key? Or
is it the best way to relate those two tables?
- Currently my Hours Worked table has no primary key, which makes me
nervous. On the other hand, I can't figure out what it would be good for if
I had it.
Any table design experts interested in commenting?
Thanks!
John