Answer the question
In order to leave comments, you need to log in
How to build a database structure with a weekly schedule, taking into account weekends and breaks?
For example, there are services that provide services, I want to attach to them a schedule with an operating mode that takes into account weekends, breaks (there may be several), the beginning and end of the working day.
For example, the following data:
Shawarma:
Tue-Fri: 09:00-18:00 Break: 12:00-12:30, 15:30-15:55
Sat: 09:00-15:00 Break: 12:00-12 :30
Mon-Sun: day off
or for example such an option
Hamburgers:
Mon-Sun: around the clock, Break: 23:50-00:10, 06:25-06:40
Answer the question
In order to leave comments, you need to log in
Two tables. The first contains the work schedule on a specific day for a specific company:
+------------+-------------+------------+----------+
| company_id | day_of_week | start_time | end_time |
+------------+-------------+------------+----------+
| 1 | 0 | 09:00 | 18:00 |
| 1 | 1 | 09:00 | 18:00 |
+------------+-------------+------------+----------+
+------------+-------------+-------------+-----------+
| company_id | day_of_week | start_break | end_break |
+------------+-------------+-------------+-----------+
| 1 | 0 | 12:00 | 12:30 |
| 1 | 0 | 15:30 | 15:55 |
+------------+-------------+-------------+-----------+
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question