I want to store Doctors and their Schedules (times at which they are available). Schedules can be such that a doctor is available on particular days of the week (eg: a doctor works only Tuesday and Thursday).
I will need to query available doctors on a range of dates, and also, query the timings of a particular doctor.
My question is:
Should I create 7 boolean columns in the schedules
table or, create a table schedule_days
with a schedule_id
and day
columns. The day
column would be an integer from 0 to 6, representing the seven days of the week.
Which implementation would be faster for reads?