I need to build a database for a small booking website. Basically we need to sell a set number of spaces per day and we want to release these only 6 months in advance and not have them available every day.
For for example, I might have
Item "PC12" (internal code) to which we have available 15 spaces per day.
Via an admin panel I'll release days periodically, say each Monday i'll release another week at the end of my 6 month range (and I might remove public holidays etc).
What I will then need to do is via a website search is search for spaces under item "PC12" for a particular date.
A search might be, do you have 4 available on date = 'ABC'
How should I set up this datebase with dates available and how many items are on each date?
I thought:
- Each date could have a row in 'available dates' table
- Have a booking table for each space sold for each date and link the date to the available dates table
preform a count if there is less the the limit say it's available?
is there a better way of doing this?