473,378 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Database design

Hi,

I am starting from scratch with a new database to manage bookings of
units. The database will store customer info, unit info, bookings,
payments etc. I have scetched a basic design and am looking for some
input and some help before I start. Any help or suggestions would be
appreciated.

Tables - Customers, Bookings, Units, PaymentsRecieved
Queries - Unit availability, Payments Due

All the above is fairly simple. However when making a booking I would
like to be able to enter the first payment date, and the payment
frequency (eg weekly, monthly etc) I would then like to be able to
query this information so that I can display a list of payments due
this week / month (it would also query the payments table to see if
the due payment had already been paid). I am unsure how to do this.
(Without entering each and every payment due date as some bookings
could be over 12 months long). Do I need a payments due table?

Further to this I would like to show a calendar of available units (eg
ones not booked / reserved) Any suggestions on whee to start with this
would also be appreciated.

Many thanks in advance.

Sep 26 '07 #1
3 2280
Hopefully your Booking table has fields like this:
BookingID AutoNumber primary key
CustomerID Number relates to primary key of Customer table
UnitID Number relates to primary key of Unit table.
StartDate Date/Time When first payment is due. Required.
Freq Number how often a payment is due
PeriodID Text type of period (yyyy, m, d, etc.)

Now you need another table that contains a record from 0 to the highest
number of periods you could ever need. It will have one field of type
Number, named (say) CountID, and marked as primary key. Save the table with
a name like tblCount. Now enter a record for each number you need, or you
can use the code in this link to populate the table for you:
http://allenbrowne.com/ser-39.html

Create a query that uses both tables. In the upper pane of query design,
there must be no line joining the 2 tables. This gives you every possible
combination. Type this expression into a fresh column in the Field row:
DueDate: DateAdd([PeriodID], [Freq], [StartDate])
Add criteria under this field for the dates you are wanting to query.

This solution works because the unjoined tables give you every possible
combination, which yields a DueDate for each time a payment is due.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"keri" <ke********@hotmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
>
I am starting from scratch with a new database to manage bookings of
units. The database will store customer info, unit info, bookings,
payments etc. I have scetched a basic design and am looking for some
input and some help before I start. Any help or suggestions would be
appreciated.

Tables - Customers, Bookings, Units, PaymentsRecieved
Queries - Unit availability, Payments Due

All the above is fairly simple. However when making a booking I would
like to be able to enter the first payment date, and the payment
frequency (eg weekly, monthly etc) I would then like to be able to
query this information so that I can display a list of payments due
this week / month (it would also query the payments table to see if
the due payment had already been paid). I am unsure how to do this.
(Without entering each and every payment due date as some bookings
could be over 12 months long). Do I need a payments due table?

Further to this I would like to show a calendar of available units (eg
ones not booked / reserved) Any suggestions on whee to start with this
would also be appreciated.

Many thanks in advance.
Sep 26 '07 #2
Many thanks for the help so far. I have done as suggested and all
works fine, the query returns the first duedate for payment after the
specified first payment date. However my brain is still failing me.

Firstly I have a choice of 2 designs;

1. The ability to show next due date (ie. after todays date) however
this limits me to information presuming the last payment has been paid
(the user would have to look elsewhere to find if the most recent due
payment has been paid). However this seems a more simple method.

2. The ability to somehow link the duedate with the payments table, so
that the database links the payments made with the due dates of
payments, and shows the next due date for a payment. If one of the due
payments did not have a linekd payment made record then it would show
the previous payment as being overdue as well as the next payment due
date. This seems more complex, however is more user friendly and
comprehensive.

I would love some advice on which of these scenarios will work, and
how to progress to starting designing these features.

Thanks,

Sep 26 '07 #3
The 2 solutions you propose would both be viable for different scenarios.

You can store the schedule of payments due in a table (your solution #2) if
you desire.
Advantage: You can schedule different dates or amounts (e.g. so a client can
make 2 payments at once, and then miss one.)
Disadvantage: Difficult for open-ended payments or where the amount could
change (e.g. where a membership is due every year for ever, or where
membership fees in future years might be increased.)

Since #2 involves a table with a record for each entry, you can take that
primary key number and use it as a foreign key in your payments table, i.e.
to say, "This payment received is for this particular payment due."

If you use #1, you might consider adding a field to the payments received
table to store the date the actual payment was due (which may be different
to the date the payment was received.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"keri" <ke********@hotmail.comwrote in message
news:11*********************@n39g2000hsh.googlegro ups.com...
Many thanks for the help so far. I have done as suggested and all
works fine, the query returns the first duedate for payment after the
specified first payment date. However my brain is still failing me.

Firstly I have a choice of 2 designs;

1. The ability to show next due date (ie. after todays date) however
this limits me to information presuming the last payment has been paid
(the user would have to look elsewhere to find if the most recent due
payment has been paid). However this seems a more simple method.

2. The ability to somehow link the duedate with the payments table, so
that the database links the payments made with the due dates of
payments, and shows the next due date for a payment. If one of the due
payments did not have a linekd payment made record then it would show
the previous payment as being overdue as well as the next payment due
date. This seems more complex, however is more user friendly and
comprehensive.

I would love some advice on which of these scenarios will work, and
how to progress to starting designing these features.
Sep 27 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Rushikesh | last post by:
I am designing a WEB BASED Accounting Software with ASP and SQL Server. For this I need some help for the Database design. My design is as follows. I)User table: User_id, UserName..... Users...
5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
1
by: Lane Beneke | last post by:
All, New to the list and a relative newbie to PostgreSQL. Please forgive stupid questions. Designing an application server for a work order processing (et al) database. I have a good handle...
5
by: trynittee | last post by:
Hello, It's been a while since I've posted. I am an intermediate user of Access. I can read simple VB code, have done complex queries, comfortable with event procedures, designing forms and...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
3
by: vicky | last post by:
Hi All, Can u please suggest me some books for relational database design or database modelling(Knowledgeable yet simple) i.e. from which we could learn database relationships(one to many,many to...
0
by: Laurynn | last post by:
# (ebook - pdf) - programming - mysql - php database applicati # (Ebook - Pdf)Learnkey How To Design A Database - Sql And Crystal Report # (ebook-pdf) E F Codd - Extending the Database Relational...
1
by: abhijitbkulkarni | last post by:
Hello, I am designing a .NET database application that uses 3 tier architecture. Starting initially, this application will be desktop application but I will convert it into a website later but...
0
by: sam | last post by:
Hi, Hope you are doing well !!!! One of our clients is looking to augment their team with “Database Architect – DB2" please find below the details and respond with
2
by: programmerx101 | last post by:
Ok, I'm looking for expert advice on this one. I have a database which keeps going into read_only mode. Sometimes it goes into read_only / single user mode. Once it was taken offline completely....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.