I currently am designing a booking system.
I have two tables:
Dates (dateID, date, day, closed) - Already populated with dates
Times (autoID, dateID, time, is_booked) - Already populated with dateID and times
What I need to do is for example:
If someone books 1-4 people then I need to find a half hour slot that is available.
However if someone books 5-8 people then I need to find an hour slot that is available.
In the ‘Times’ table I already have slots fill with times and dateID for the next 20 years.
I am getting lost in how to search for the hour slot (which would be two records one after another, as long as they are not booked)
If anyone can suggest the best way to do this it would be appreciated.
Wow.
Mode is a lot of fun!
Valuable resource!
Thanks for pointing this out!
So this is only for SQL strict queries, correct?
Is there a mysql or postgresql online equivalent?
All leading SQL DBs have windowing functions. Once you get to grips with them, they’re extremely powerful. We’ve built a highly performant diary search and filter function that has saved our users hours weekly finding and scheduling patients.