By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,526 Members | 1,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,526 IT Pros & Developers. It's quick & easy.

Reservation DB Schema and Date checking

P: 35
I'm trying to create a room reservation system for school using wicket and MySQL, and I'm a bit confused with this one. I've already created the user database and rooms database. My question is how do I create a schema that accepts both repeating and non-repeating schedules?

example (repeating):
I can reserve a room for class at 9:00am - 12:00pm every Monday and Thursday, from June - October of 2009. How do I represent this in the schema?

example 2 (non-repeating)
I can reserve a room for a meeting from 12:00pm - 1:00pm on Sept.19, 2009.

How can I do both with one schema?

I've made a temporary schema that only accepts non-repeating input with the following columns:

- reservationID (the primary key)
- itemID (item to be reserved)
- start (start date&time)
- end (end date&time)

my question is, before I insert another reservation, what query do I use to check that there's no other reservation on that same date and time?

Thanks for the help guys. I really appreciate it.
Sep 16 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.