I wrote an windows form app in c# that makes a presence/delay log for employees and now I'm trying to add a feature to that app which does the following :
To make it more clear :
ID--name----------presence-----delay
1--sam--------------1----------0---
2--jack-------------0----------0---
3--ted--------------1----------1---
Day---------------present----delay-----absent
14/10/2012---------sam--------ted-------jack
------------------------ted-----------------------
and so on, i hope i made my idea clear.
how will the second table look like and how will the relation be ?
how will i view the result like the one in the date table ?
--Person-- --Presence-- --Delay--
ID ID ID
Name Date Date
// other info PersonID PersonID
IsPresent
First of all, you should hold Person
table separately and use it's ID
in other tables. I strongly recommend reading about data redundancy and database normalization. PersonID
in the other tables refer to ID
in Person
table.
I think Presence
should be logged for each day. Delay
should be logged if only the Person
shown up late that day.