So if you needed to know status of a work day for an employee day (say 9/1/2003), how did you go about looking it up in your table? Assuming that a employee can be present (p), on vacation (v), sick day (s)? Your table seems to store only the number of hours worked....
Thank you, Syed Ali (609) 951-2989 -----Original Message----- From: Dan Greene [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 11:12 AM To: Syed Ali; [EMAIL PROTECTED] Subject: RE: Representing time sheet data in Mysql In the last timetracking system I built, I used a 'timeentry' table which was basically timeentry_id (pk) employee_id date num_hours_worked task_id I put a few other indexes in there based on the searching that I had to do, but to each their own... > -----Original Message----- > From: Syed Ali [mailto:[EMAIL PROTECTED] > Sent: Monday, September 29, 2003 11:04 AM > To: [EMAIL PROTECTED] > Subject: Representing time sheet data in Mysql > > > > Hello, > > I am trying to store our timesheet data in the Mysql database. > I would appreciate suggestions on the database scheme to use. > > One of the possible ways to do it is to have a table indexed > with the employee ID and then having as many columns as there > are days in the year. > This approach would mean that the table has 200 rows if we > have 200 employees and it has 365 columns for each day of the year. > > Another approach would be to index based on the number of > days, i.e., have 365 rows and have as many columns as > employees, i.e., 200 columns. > > If an employee takes half a day off, then I can store an > array in the value for that employee ID and that particular day. > > I am sure there are other approaches to, and I would > appreciate any suggestions. > > > Thank you... > >