I have a website where you can choose a timeslot via a dropdown box. The items in the dropdown box would be something like:
- 6AM - 10AM
- 10AM - 1PM
- 1PM - 4PM
i store this in a database table with 2 columns. Id and Description. (so i am simply storing the string "6AM - 10AM" in a varchar field)
I now need to add a datepicker so the user can pick a date AND a timeslot. I got a datepicker all wired up and then i realized that i have a new requirement:
I need to support a different set of timeslot depending on the day. So for example, if it was a friday, it might be:
- 6AM - 10AM
- 10AM - 1PM
- 1PM - 4PM
but if it was a Saturday, it might be:
- 6AM - 8AM
- 8AM - 12PM
- 1PM - 2PM
I am trying to figure out what new tables i need to store this information. My initial thoughts were.
Don't create any new tables but simple add an extra field called DayOfWeek and when i need to load up my dropdown i query based on the current day of the week and just pickout timeslots
Create new table to try to join days of week with time slots to have it more normalized.
I wanted to see if people had feedback on what would be an ideal database table design for storing this information.