
December 8th, 2003, 03:14 AM
|
|
Registered User
|
|
Join Date: Jul 2003
Location: Brisbane, Australia
Posts: 12
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Out of the Ordinary Database Design
I've got to design a database, and the requirements for this database are somewhat out of the norm, and it's causing me some problems. If anyone can offer some tips, they would be greatly appreciated.
Basically, my client's business can take appointments that are recurring weekly, fortnightly or monthly. Alternatively, there may be once-off appointments.
Weekly and fortnightly appointments can have several days associated with them: A customer may wish to make an appointment for every Monday and Tuesday for example (a weekly appointment with two occurances).
Monthly appointments may only take place once a month, so this isn't a huge problem.
Once off appointments only take place once for the lifetime of a customer, or are irregular enough that they do not fit into the above categories.
My initial idea was to create a "Booking" table which has a "BookingType" field that indicates whether the booking was weekly, fortnightly, monthly or once-off. Then, depending on the value of this BookingType, other tables may be looked up. In the case of weekly and fortnightly appointments, there is a separate table for each to indicate what days of a week should be associated with that recurring appointment (e.g. WeeklyAppointmentDay). All of these ancillary tables refer back to the main Booking table via a unique ID (implemented using MySQL AUTO_INCREMENT fields)
It feels like it's becoming awfully complex and hackish very quickly. How can I improve on the above? Let me know if I can provide any more information to assist you in assisting me!
|