Question : Creating tables and relationships with normalisation

I'm trying to build a database which will store a staff member's daily working statistics. I just need a little guidance to see if I have my tables correct and would appreciate any guidance/correcting. I'll try to explain the process of what we would do hopefully it'll help a little easier.

To begin with, it would hold a staff member's individual working hours for that day.
I.e. HoursAvaliable (for that day), HoursHoliday, HoursSickness, etc

 This would be then used to calculate a GrossAvaliableHours (HoursWorking, HoursOvertime and so on) and GrossUnavaliableHours (Sickness, Holidays, Meetings, Etc) which calculate to provide the NetAvaliableHours. None of these GrossAvaliable/Unavaliable or NetAvaliable are stored anywhere, they are calculated 'on the fly'

The next process is to input the staff members targeted work for the day (which is generally based on their HoursWorking. Ie they're here for 12 hours so they are targeted with 12 hours of work&) . The target work is produced by choosing a task name which shows the task time and inputting a guided amount to be completed&which then is calculated to give a final result of the time for that task.
In the end eventually showing a sum of the totals to provide the "targeted hours of work" (again task totals and total targeted hours of work are not stored anywhere)
The final process is the Actual Work completed, I think this would be the same as the Target work table essentially&You'd be inputting the actual work completed by the staff individual to give the total times of the tasks they actioned (not necessarily the same tasks as the targeted though!).

I hope this isn't confusing haha, I've taken a stab at the normalisation and tried to explain myself as much as I can above to help anyone here understand.

Attached is a word document with a list of the fields involved and how I think they would be normalised into their own tables.

Answer : Creating tables and relationships with normalisation

Initial thoughts are that you definitely don't need a table with dates in - just index your date fields to allow faster query response times....

Normalisation is quite a big topic, but essentially there's two types of table - one relates to each type of entity you are recording - e.g. Staff, Task. Data is only stored that relates directly to that entity, and each record is identified with a unique primary key (usually a single auto increment number, although you can combine multiple fields as a PK)

The other type of table is where primary keys are taken from two or more tables to create a new primary key in the "linking" table.

I'm sure you'll get quite a few more suggestions on this and certainly this post only scratches the surface. A google search on "Entity Relationship Diagrams" will probably give you moer reading matter....
Random Solutions  
 
programming4us programming4us