473,786 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table Structure

Hi all,

I'm designing a club database and have encountered a problem when trying to
extract the total amount of fees that a Student/Family is suppose to pay
during their time of membership. I've already designed the tables and
relationships but I want your advice to see if my design was right.

In my older version a member pays the fees but when there's 2 or more
members that belong to a family (brother, sister, mother, father etc), it's
the family that pays the fees. My solution was when a person joins, that
person is assigned to a current family or a new family is created if this
member doesn't have any family enrolled. If there are more than one person
that belong to a family, they pay discounted rates (family rates) as long as
there are more than one family member still enrolled. I need to record when
each member of the family joined (they all could have joined at the same
time or at different times) and when the discounted rates are applied.

When one person of the family leaves the rates are adjusted accordingly and
the date when this happened should also be recorded. To complicate things
more that person who left may come back again at a later date (or maybe a
different person of the family) so the fees should be set again.

To sum up:
A member belongs to a family but a family can have many members enrolled.
It's the family the pays the fees even if the family consists of one member.
Need to keep track of when a member enrols, leaves and maybe re-enrols.
Need to track when extra members of a family joins and leaves and what the
fees that family should be paying during that time period.
Need to record when fees were paid.

If you think that a member should pay fees is a better idea than a family,
let me know if that is a better solution but when more than one person of
the family joins, each individual will pay a reduced rate for the period of
time that there are more that 1 family member enrolled at the same time.

My final goal is to work out how much that family is supposed to have paid
from the date the first member joined when the amount of fees that family
pays per payment period will change throughout time.

Any ideas on a table structure? If you think I'm on the wrong track, please
guide me on the right path.

TIA
Stewart

P.S. Will post my current table structure in a day or two or after there has
been a couple of replies
Nov 12 '05 #1
5 2071
rkc

"Stewart Allen" <sa****@ThisPar tNotVailid.wave .co.nz> wrote in message
news:bu******** **@news.wave.co .nz...
I'm designing a club database and have encountered a problem when trying to extract the total amount of fees that a Student/Family is suppose to pay
during their time of membership. I've already designed the tables and
relationships but I want your advice to see if my design was right.
<snip stuff>
Any ideas on a table structure? If you think I'm on the wrong track, please guide me on the right path.


Don't know what track you're on because you didn't post what you say
you have done.

Here's my first impression.

Group (GroupID, RateID)
Member (MemberID)
Membership(Memb erID, GroupID, StartDate, EndDate)
Rate (RateID, Duration, TotalMembers, Amount)

I'll explain why if you care.

Nov 12 '05 #2
"rkc" <rk*@yabba.dabb a.do.rochester. rr.nope> wrote in message
news:lX******** *********@twist er.nyroc.rr.com ...
<Snip>
Don't know what track you're on because you didn't post what you say
you have done.

Here's my first impression.

Group (GroupID, RateID)
Member (MemberID)
Membership(Memb erID, GroupID, StartDate, EndDate)
Rate (RateID, Duration, TotalMembers, Amount)

I'll explain why if you care.


My interpretation of your answer.
*Group table*
GroupID (PK)
RateID (FK) from Rate table

*Member table*
MemberID (PK)

*Membership table*
MemberID (FK) from Member table
GoupID (FK) from Group table
StartDate
EndDate

*Rate table*
RateID (PK)

Membership is an intermediate table between Member and Group so there's a
many to many relationship between the two. The rate is assigned to the group
which includes the duration of the amount the group pays and the total
amount of members at that time.

I have a couple of question regarding this.
How do you store the duration when they're still enrolled? e.g.
MemID FName LName
1 Joe Smith
2 Sue Smith
3 Fred Smith
All belong tho the same family so special rates apply.

Joe joined first and the rate is $20.00 per period. Sue joins 2 months later
and now that rate is $30.00 for both of them. Fred joins 3 months later and
now the rate is $40.00 for all three of them. 1 month later Sue leaves so
the rate reduces back down to $30.00. Joe and Fred are still enrolled at the
club so how do you store the duration if the membership is still current? If
Joe started 1 year back and the payment periods are monthly, the total
amount that this family is supposed to have paid is $350.00. After 1 more
month of membership the total due is $380.00.

With my example above and the Membership table having 2 FKs to create the
PK, what happens when the case arises when Sue leaves or is the StartDate a
FK too?

Stewart

Nov 12 '05 #3
rkc

"Stewart Allen" <sa****@ThisPar tNotVailid.wave .co.nz> wrote in message
news:bu******** **@news.wave.co .nz...
Membership is an intermediate table between Member and Group so there's a
many to many relationship between the two. The rate is assigned to the group which includes the duration of the amount the group pays and the total
amount of members at that time.

I have a couple of question regarding this.
How do you store the duration when they're still enrolled? e.g.
MemID FName LName
1 Joe Smith
2 Sue Smith
3 Fred Smith
All belong tho the same family so special rates apply.

Joe joined first and the rate is $20.00 per period. Sue joins 2 months later and now that rate is $30.00 for both of them. Fred joins 3 months later and now the rate is $40.00 for all three of them. 1 month later Sue leaves so
the rate reduces back down to $30.00. Joe and Fred are still enrolled at the club so how do you store the duration if the membership is still current? If Joe started 1 year back and the payment periods are monthly, the total
amount that this family is supposed to have paid is $350.00. After 1 more
month of membership the total due is $380.00.

With my example above and the Membership table having 2 FKs to create the
PK, what happens when the case arises when Sue leaves or is the StartDate a FK too?

First, the Group table doesn't need the RateID. It's retrieved from the Rate
table
on an individual basis.

My thought was that the Membership table would track one membership period
for one member. The GroupId would be used to count the number of members
in that group at the time the fee is paid. Every member would be in a
group, even
if that member is the only person in the group. The fee would be based on
the number of people in the Group and the duration of the membership. The
amount due would be taken from the Rate table based on the number of
members and the length of time signed up for.

So when Joe comes in to sign up for another month on 2/1/2004 Sue's
membership that expired on 1/1/2004 isn't counted.

Something like

SELECT Count(*) as NumberOfMembers
FROM MemberShip
WHERE GroupID = [Joe's Group ID]
AND EndDate > [Sign up Date]
AND MemberID <> [Joe's Member ID]


Nov 12 '05 #4

"rkc" <rk*@yabba.dabb a.do.rochester. rr.nope> wrote in message
news:o8******** ********@twiste r.nyroc.rr.com. ..

"Stewart Allen" <sa****@ThisPar tNotVailid.wave .co.nz> wrote in message
news:bu******** **@news.wave.co .nz...
Membership is an intermediate table between Member and Group so there's a many to many relationship between the two. The rate is assigned to the group
which includes the duration of the amount the group pays and the total
amount of members at that time.

I have a couple of question regarding this.
How do you store the duration when they're still enrolled? e.g.
MemID FName LName
1 Joe Smith
2 Sue Smith
3 Fred Smith
All belong tho the same family so special rates apply.

Joe joined first and the rate is $20.00 per period. Sue joins 2 months

later
and now that rate is $30.00 for both of them. Fred joins 3 months later

and
now the rate is $40.00 for all three of them. 1 month later Sue leaves so the rate reduces back down to $30.00. Joe and Fred are still enrolled at

the
club so how do you store the duration if the membership is still current? If
Joe started 1 year back and the payment periods are monthly, the total
amount that this family is supposed to have paid is $350.00. After 1
more month of membership the total due is $380.00.

With my example above and the Membership table having 2 FKs to create the PK, what happens when the case arises when Sue leaves or is the

StartDate a
FK too?

First, the Group table doesn't need the RateID. It's retrieved from the

Rate table
on an individual basis.

My thought was that the Membership table would track one membership period
for one member. The GroupId would be used to count the number of members
in that group at the time the fee is paid. Every member would be in a
group, even
if that member is the only person in the group. The fee would be based on
the number of people in the Group and the duration of the membership. The
amount due would be taken from the Rate table based on the number of
members and the length of time signed up for.

So when Joe comes in to sign up for another month on 2/1/2004 Sue's
membership that expired on 1/1/2004 isn't counted.

Something like

SELECT Count(*) as NumberOfMembers
FROM MemberShip
WHERE GroupID = [Joe's Group ID]
AND EndDate > [Sign up Date]
AND MemberID <> [Joe's Member ID]


Thanks rkc. I'll have a good look at this and see if I can modify what I've
done.

Here's my current table structure:
**tblMembers**
MemberID (PK)
FamilyID (FK) from table FamilyNames
FName
LName
etc

**tblFamilyName s**
FamilyID (PK)
FamilyName

**tblMembership **
MemberID (FK) from tblMembers
MemTypeID (FK) from tblMembershipTy pes
StartDate
EndDate
The first 3 fields combine to create a primary key

**tblFamilyRate s**
RateID (PK)
FamilyID (FK) from tblFamilyNames
Rate
StartDate
EndDate

**tblMembership Types**
MemTypeID (PK)
MemType

**tblFeesPaid**
FeesID (PK)
FamilyID (FK) from tblFamilyNames
DatePaid
AmountPaid
ReceiptNo

**Relationships **
tblFamilyNames 1-M tblMembers
tblFamilyNames 1-M tblFamilyRates
tblFamilyNames 1-M tblFeesPaid
tblMembers 1-M tblMembership
tblMembershipTy pes 1-M tblMembership

The FamilyRates table records what that family is supposed to pay at any
given period of time. If the EndDate is null in a record that means that
this is the family's current rate. Whenever somebody of this family enrols
or leaves, this table is updated with the EndDate field completed and a new
record created with the new Rate and StartDate. This table doesn't get
touched again until the number of members in this family changes again.

The Membership table records when a member joins and quits. It's on the many
side of the Members because they sometimes rejoins so this needs to be
recorded. If the EndDate field is null, it means that the member is still
enrolled.

When somebody joins they're assigned to an existing family or a new family
is created if they haven't got any brothers/sisters etc that are already
enrolled. Dev's fConcatChild function is used to link all family members
together. This way it's the family that pays the fees not the individual
even if there is only one person that belongs to that family.

What I forgot to mention in my original post was that some families don't
pay on time, maybe miss a couple of payments over 6 months and then start
paying regularly again. It may seem that they're up to date because they're
paying regularly but they are behind.

Finding out the total a family has paid is easy and also the total number of
family members enrolled at any given time period is also easy. What I'm
after is to find out how much the family is supposed to have paid from the
time the first member joined to now when other members of the family have
joined and left which effects how much the family pays at that period of
time. e.g. $20.00 for 1, $30.00 for 2, $40.00 for 3.

Is my table design correct? I'll redesign the whole database if necessary.

Stewart
Nov 12 '05 #5
rkc

"Stewart Allen" <sa****@ThisPar tNotVailid.wave .co.nz> wrote in message
news:bu******** **@news.wave.co .nz...
Is my table design correct? I'll redesign the whole database if necessary.


I would never presume I was able to tell you whether your table design is
right or wrong. I don't know all the requirements and if I did I wouldn't
start by designing tables.

Here's a model from a fellow who thinks he is right enough to post his
work on a site called DatabaseAnswers . Maybe you will see some value
in it.

http://www.databaseanswers.com/data_...lubs/index.htm
Nov 12 '05 #6

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

Similar topics

0
1845
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000 Content-Type: Text/Plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable
0
2442
by: Randall Sell | last post by:
Hello all, I am migrating a Paradox application to SQL Server. My problem is that the existing Paradox table structure is limited. Correcting it will mean a re-write of the application (Delphi app). Although the record and column limits are higher in SQL Server, it will eventually hit the wall. So I was wondering if anyone could offer advise on how we might do this best.... The application is essentially an evaluation tool. It is very...
36
4657
by: toedipper | last post by:
Hello, I am designing a table of vehicle types, nothing special, just a list of unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor etc etc For the table design I am proposing a single column table with a field name called vehicle_type and this will contain the vehicle type. Sot it will be
3
752
by: Ben | last post by:
Hi everyone, Now I am using Visual Basic.net to write a program but having some headaches. The situation is as follows: I am using ODBC connection to connect one database( non-SQL server) , which has over 20 tables and each table has lot of fields. My aim is to setup a button, everytime when the button is clicked, the selected tables through the ODBC connection will be copied to a SQL server 2000 ( Both the data and table...
4
3260
by: Laphan | last post by:
Hi All Wonder if you could help, I have a bog standard table called STOCKPRICES that has served me well for a while, but now I need to change the structure of it and because a number of users have used it in it's present form I need to so the following in SQL script: a) Grab a snapshot of the current SQL data. b) Re-structure the STOCKPRICES table.
4
15839
by: maricel | last post by:
I have the following base table structure - DDL: CREATE TABLE "ADMINISTRATOR"."T1" ( "C1" INTEGER NOT NULL ) IN "TEST_TS" ; ALTER TABLE "ADMINISTRATOR"."T1" ADD PRIMARY KEY
5
1899
by: brett valjalo | last post by:
Hey Gang! SORRY ABOUT THE LENGTH! Nice to see some of the same faces around this place from way back when ... Whatta buncha CDMA addicts some o' y'all are ;) Don't get me wrong, I understand, believe me! Took me a lot of therapy, various 12-step programmes, interventions by loved ones, etc, but I finally managed to excavate, er, extricate myself from the
117
18578
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of elements in the HTML to get everything just right. When you consider the class attribute on the DIV elements, there's not much size savings anymore for using DIV. There are other disadvantages to not using TABLE/TR/TD, such as the lack of ability...
2
2114
by: Dave Ekhaus | last post by:
hi i'm new to javascript. i'm hoping to get some help and find out if what i want to do is possible and - assuming it is, get some tips on how to accomplish the task. ok - assume i have a table, the contents of which are dynamic. there can be any number of rows in this table - somewhere between 50 and 500 would be the range. in each row - there can be any number of td's. the relative 'width' of a td in a tr is specified by a td's...
4
10327
by: Alvin SIU | last post by:
Hi all, I have 6 tables inside a MS Access 2003 mdb file. I want to convert them as DB2 version -8 tables in AIX 5.2. I have exported them as 6 XML files. The XML files look fine. Each record is embeded by a tag which is the table name.
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.