472,133 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,133 software developers and data experts.

Reservation DB Schema and Date checking

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
0 2144

Post your reply

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

Similar topics

3 posts views Thread by Kimmo J?rvikangas | last post: by
2 posts views Thread by David Slinn | last post: by
1 post views Thread by Stefan Reiter | last post: by
5 posts views Thread by KarlM | last post: by
1 post views Thread by jimmy | last post: by
11 posts views Thread by jimmy | last post: by
1 post views Thread by brucepickford001 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.