We are developing a MySQL database (with interface and backend) with holiday packages. We have all figured out, except for the best method for storing travel package departure dates .
Some packages are available almost every day of the year; others are only available on tuesdays and in environments; others leave every Monday from May to September; other packages depart only a few specific dates throughout the year; etc. etc.
We need to associate each tour with suitable departure dates. Then we need to execute queries like “give me the packages that are available on date X”, “give me packages that I can take in the first week of January,” “give me these tours between the dates X and Y”, etc.
A trivial way to do this: store 365 bits per bit per day for each packet . But this is obviously not a good solution in terms of storage space. Keeping date ranges would be a good solution, but this was not due to the fact that most packages are only available on certain days of the week and therefore it is not possible to optimally encode in ranges.
Anyone can help us with this? How can we save the departure dates of the tour in the database?
Thank you so much!
Ramon