Answer the question
In order to leave comments, you need to log in
What are the ways to store the mode of operation of institutions?
Colleagues!
Please share your experience when trying to optimally and flexibly keep the working hours of institutions for a week.
Perhaps someone has experience encoding an hourly table into a matrix?
Answer the question
In order to leave comments, you need to log in
You deliberately introduce denormalization and break even the first normal form.
Think about what the SQL query will look like that will look in your packaged table for organizations working on Monday at 2 pm and at 6 pm. If it suits you in its complexity, you can leave the solution, if not, normalize it.
You can pack as you like, depending on what you need to display later.
If the work is without lunch, it is enough to store the beginning and end of the working time for each day of the week. If with lunch, add the start and end times of the lunch. If the interval is complex - store for each hour the sign "working / not working", you can pack the whole day into 24 characters or 24 bits.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question