This example uses pivot tables, analytic queries, and hierarchical queries in Oracle to determine when someone’s next available appointment is open.
I worked on a similar problem several years ago. We were able to change the solution by changing the underlying store. Instead of working with an actual date, we “published availability“ within a single column based on 15-minute increments. A single column might have a value “0110“, meaning that a single resource is available for 30 minutes beginning at 15 past the hour. We could then total up the number of available appointments for all individuals and use this for appointment scheduling. A customer calls in and needs a worker to come to their house and install cable or phone line, you need to know if anyone is available to do this work (and you need to figure it out very quickly).
We could then add in other facilities, like assigning weight to an organization, making them the preferred installer group. This gave us the ability to work with contract installation groups.
It is always neat to see different views of the same problem set.