db design (1 Viewer)

JPR

Registered User.
Local time
Today, 01:58
Joined
Jan 23, 2009
Messages
192
Hello,

I was thinking to design a simple db to manage the daily prices of a small apartment which I rent.

Because this apartment has three room (Room A, Rooom B and Room C) I would like to ask your opinion on what is the best wasy to design this db.ù
My idea was to create some sort of calendar which could be associated to each room.
Once I select the room from a cboBox, then the calendar should show up and allow me to enter the room rates in each day or in a from to method.

Do you think my idea is ok or do you recommend something different. Thank you
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 03:58
Joined
Feb 28, 2001
Messages
27,217
The problem with calendars in the literal sense is that they are never-ending. Further, if you want them to not only tell you what IS booked, but what WAS booked, you can't easily get rid of them, and thus you get a huge pile of calendar records that just never go away. Most booking systems I have seen (which is certainly NOT all the systems that there are) will use a "booking slip" concept where you have a customer who books from a starting date to an ending date. You should be able to search the forum for "Booking" because we've had only about a gazillion of those questions. Some of them will be useful, probably.

I'm omitting some details because you wanted design-level info. You might have something like this:

You need a ROOMS or UNITS table (however you want to call it) starting with three entries to describe three apartments or rental units.
You would have a TENANT table to describe details about current tenants and to track info about prior tenants (if needed).
Then you would have a BOOKING table that has the TenantID, a UnitID, a starting date, and an ending date. NOTE: You can easily use a "fake" date for the ending of the booking. E.g. pick an arbitrary future date that is longer than either you or your tenant is likely to live. 31-Dec-9999 actually IS a legal date, for example, and Windows allows it. If your tenant says "I'm moving out on St. Swithin's Day" then you only have to edit the booking record's ending date, nothing else.
If you are tracking rent payments, you have a PAYMENT table that has the unit ID and customer ID and date and amount. (If you want, you can even add a TYPE code for DEPOSIT as well as for MonthlyRent.
If you are tracking maintenance info, you can have a MAINT table that links back to UNITID and has a date and cost.

What I suggested was a more or less normalized design. If you are not familiar with the concept of normalization, search this forum for "Normalization" or search the web for "Database Normalization" and read a few articles on the topic. If you do the web search, you have to qualify it with "Database" because other disciplines use the word "Normalization" as well. Also, if you are searching the web, look first at a couple of .EDU sites because the .COM sites have something to sell you a lot of the time. Once you are more comfortable, the .COM sites DO have some pretty good articles.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:58
Joined
Feb 19, 2002
Messages
43,331
Do you not have standard rates? Usually the break is weekend and weekday. Business class hotels charge more for weekdays but less for weekends just to fill the hotel and vacation rentals use the opposite pricing. More for weekends and less for weekdays. You might also have a weekly or monthly rate. The rates could be different for each of the three rooms depending on whether they have attached baths or views or whatever. Maybe the rates are seasonal.

Tell us what your pricing scheme is for starters unless you really want to manually enter a price for every booking. Pricing models can be very complex.
 

JPR

Registered User.
Local time
Today, 01:58
Joined
Jan 23, 2009
Messages
192
Thank you both for hour help and suggestions.
i was thinking of starting with a fix but different rate for each room as they are all different and offer different services. Obviously rates will change each month.

After I have entered the basic rates for a given month (this will have to done manually (unless create a table with a list of rates and pull them up with a combo) I may I could happen that I want to change them. This is where I will need to open the calendar, select the room who’s rates need to be changed and proceed with the change. I would like to be able to change the rats for a single day or for a specific period. Thank you
 

JPR

Registered User.
Local time
Today, 01:58
Joined
Jan 23, 2009
Messages
192
Sorry for the delay in aswering. Yest, rates can change every month and I will type them in manually
 

Users who are viewing this thread

Top Bottom