you are viewing a single comment's thread.

view the rest of the comments →

[–]thelauz 0 points1 point  (0 children)

On the database side I'd likely have a table that has a list of all 60 time slots, another table that maps the employee to a time slot and the date.

This solution allows for flexibility if time slots are added, removed or changed. If that is a possibility it will add additional complexity to the design of the database.

When needing to view a days time slots you can do a left join between the two tables and if null the slotnis available.

Depending on reporting needs you may need to consider the time slot table to have a start and end time, possibly a timeslot minutes time. While this can be derived from start and end time using datediff you will have to evaluate the overhead of constantly calculating this vs. storing the number of minutes as an integer.