473,387 Members | 1,573 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,387 software developers and data experts.

Grouping individuals and collection information for families

I'm building an attendance database for adults and children. I would like to know what the best way is to connect parents and spouses so that the information is displayed based on the family, not just the family name.
Currently I have set up a separate table for children and adults because their fields are different (i.e the table for children does not have a field for marital status). Ideally I would like the children's info form to appear based on how many children the parents say they have. I would also like to somehow group the children and parents or spouses together as a unit.
Any suggestions are greatly appreciated
Jan 2 '13 #1
2 1565
zmbd
5,501 Expert Mod 4TB
Please keep in mind that as we work thru this that Bytes is not a code writing nor homework service. Please read the FAQ and posting guidlines.


Good database design is the most difficult part of the process and it appears that you are already trying to use some of the normalization concepts and the like. So just a refresher on database design and normalization: A Tutorial for Access and a follow-up with Database Normalization and Table Structures.

given that there are a few dozen ways to do this, I'm going to borrow from a concept I used in a membership database because I think that is the same type of information you're after):

(note : tbl_* is a table name
[] denotes a field; () defines the field type; fields with "pk" in the nameare primary key fields for the table; fields with "fk" in the name are forgien keys refering to another table)

tbl_family
[family_pk](autonumber)
[family_name](text(25))
[family_otherinformation1](text/number etc)
[family_otherinformation2](text/number etc)
(etc..)

You really wouldn't need a seperate table for childeren and adults, you simply wouldn't need to enter data into the unrelated fields and you can design a form so that the unrelated fields are locked or even a seperate form; thus,

tbl_members
[member_pk](autonumber)
[member_name](text(25))
[member_fk_family](numeric(long) 1:M with tbl_family)
[member_otherinformation1](text/number etc...)
[member_otherinformation2](text/number etc...)
(etc...)

You could have a field that indicates child, spouse, etc... or maybe a seperate table that shows relationship between members and the relationship type (spouse, parent-father, parent-step-father, etc...)

tbl_relationship
[relationship_pk](autonumber)
[relationship_fk_family](numeric(long) 1:M with tbl_family)[relationship_fk_member_1](numeric(long) 1:M with tbl_member)
[relationship_fk_member_2](numeric(long) 1:M with tbl_member)
[relationship_relationship]((numeric(long) 1:M with tbl_type)

Then we need:
tbl_type:
[type_pk](autonumber)
[type_relationship_name](text(25))


So table tbl_relationship would have an entry for each member and the corresponding relationship
So If you have Family1 with Alpha and Beta are spouses and have child Delta you might have
(now of course I've used text here, the table would be all numeric)
(1)(family1)(alpha)(beta)(spouse)
(2)(family1)(beta)(alpha)(spouse)
(3)(family1)(alpha)(Delta)(Parent-Father)
(4)(family1)(beta)(Delta)(Parent-Step-Mother)

So,
With a simple select query, if you were interested in "Family1" then you you would find the PK in tbl_family and then do a select query against tbl_members where [member_fk_family] was equal to the PK from tbl_family. You could use that same basic query against tbl_relationship to pull that information.

Say you have a child (delta) you could look that child up in tbl_members, find the value for the family pk and then pull information from the other tables as to the family or find other siblings and so forth.
Jan 2 '13 #2
NeoPa
32,556 Expert Mod 16PB
I would say that the layout outlined for you by Z is what you should be working from. It's not complete, but it is normalised and extensible (unlike most other attempts to handle what is essentially a very tricky setup). I must warn you that, though changing your design, and even using such a design, can be complicated and somewhat troublesome to get to grips with, it is nevertheless far more robust in the long-run, and apposite for your data. This latter point will prove to be very important the more you try to do with your data.
Jan 3 '13 #3

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

Similar topics

2
by: Debbie Davis | last post by:
Hi there, SQL 2000 I have the following query: SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals GROUP BY sponsor Works great, returns the sponsor and the total * 2 of their...
2
by: Andreas Håkansson | last post by:
Seeing how my previous post seem to have fallen between the cracks, I thought I would have a second, more direct, go at it. So my question is "Is it possible to group (Muenchian method) over...
2
by: Iain Miller | last post by:
I'm quite new to working with Access (using Access 97) and I'm trying to develop an application. I've had a look at the Access help & also had a look through Google but to no avail (maybe I'm not...
1
by: Mark Dicken | last post by:
Hi All I have found the following Microsoft Technet 'Q' Article :- Q210368 -ACC2000: How to Pass an Array as an Argument to a Procedure (I've also copied and pasted the whole contents into...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
0
by: Joe Schmoe | last post by:
I am working on an ASP.NET application that generates an Excel 2003 spreadsheet on demand for the user, containing much sales information, and then editable cells for the salerep user to enter...
6
by: BobAchgill | last post by:
Has anyone had success with writing text using a private font that was not already installed to the system? When I try the example code in NET Framework Developer's Guide called “Creating a...
4
by: Chris | last post by:
I tried to retrieve the digit grouping symbol in MSAccess but unfortunately 3;0 is retrieved instead of comma which is my symbol. Function retrieves decimal symbol and list separator without any...
0
by: Roman Bertle | last post by:
Hello, I try to format monetary values using the locale module, python2.5: Python 2.5.2a0 (r251:54863, Jan 3 2008, 17:59:56) on linux2 Type "help", "copyright", "credits" or "license" for...
1
by: Benjamin Cohen | last post by:
I am trying to use the Microsoft collection tool to (1) collect data from individuals and (2) once they have submitted their information to have them validate or update as required. I have created...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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,...
0
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...

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.