We are developing a MySQL database (with frontend and backend) with holiday packages. We have everything figured out except for the best method to store the departure dates of the tour packages.
Some packages are available almost every day of the year; others are only available on tuesdays and wednesdays; others leave every monday between May and September; other packages depart just a few specific dates along the year; etc etc...
We need to associate each tour to the appropiate departure dates. Then, we need to perform queries of the type "give me those packages that are available on date X", "give me packages that I can take on the first week of January", "give me those tours between date X and Y", etc.
The trivial way to do it would be to store 365 bits, on bit per day, for each package. But this is obviously not a good solution in terms of storage space. Keeping ranges of dates would be a good solution it it weren't for the fact that most packages are available only on certain days of the week, and therefore, cannot be optimally codified in ranges.
Anyone can help us out with this? How can we keep the tour departure dates in the database?
Thanks a lot!
Ramon