![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Re: FMPro 7 Limited experience with MS Access... Lots of experience with FMPro from early versions to 5.5... Now working with FMPro 7... Wish to set up dbase for secondary school development office... Includes alumni, parents of alumni, businesses, friends, etc. that would house demographic type info... Also will have annual fund donation history, events attended (reunions, auctions, golf, etc) history, etc.... Understand establishing primary keys, etc.... Question involves establishing relationships... Not the dabse kind... But any relationships that exist between or among the individuals in the dbase... Examples - brothers or sisters, parents, grandparents, etc.... I don't believe that I can establish keys to fields in the same table... Seem to remember something from Access called a join table... How should I set up the table structure to accomplish this? Thanks, Al |
#3
| |||
| |||
|
|
In article <WFEHc.58057$P7.36493@pd7tw3no>, 42 wrote: A sibling relationship between 2 brothers requires a record representing person is related-persons brother, and another record representing related-person is persons brother. No, that is not required. If we know that Joe is Bob's brother, then we know that Bob is Joe's brother by inference. There is no need to record this relationship twice. Assume that we have a table that records basic facts about people. It might look like this: create table people ( person_id int not null, fname varchar(128) not null, lname varchar(128) not null, mname varchar(128), sex enum('M', 'F') not null, DOB date not null, primary key (person_id) ); Now, if we're interested in sibling relationships, it's easy enough to create a table to record those facts: create table siblings ( sib1 int not null, sib2 int not null, primary key (sib1, sib2) ); Once we have recorded the fact that sib1 is a sibling of sib2, there is no point in recording the fact that sib2 is a sibling of sib1: that is implied by the already-recorded relationship between these two people. The fact that Joe and Bob are brothers is one fact, and it should only be recorded once. |
#4
| ||||||
| ||||||
|
|
In article <IFNHc.62449$P7.32998@pd7tw3no>, 42 wrote: A sibling relationship between 2 brothers requires a record representing person is related-persons brother, and another record representing related-person is persons brother. No, that is not required. If we know that Joe is Bob's brother, then we know that Bob is Joe's brother by inference. There is no need to record this relationship twice. The fact that Joe and Bob are brothers is one fact, and it should only be recorded once. First off, in your version, if I want to find out who Joe's siblings are then I have to look in sib1 *and* sib2. That's twice as much work during retrieval, and I have to do this extra work every time I want to see Joe's siblings. Computers are fast, and the extra work is trivial. The important point is that a database is essentially a collection of facts and recording each fact only once is fundamental to good design. |
|
That also makes it more cumbersome to build filemaker portals I can't comment on those. |
|
Second, the user is looking at more relationships than just 'siblings'. Is he supposed to create a table for every relationship he wishes to track? siblings, parents, uncles, grandparents, etc... Well, before we can give him useful advice about that, we'd have to know what relationships he really needs or wants to track, which we don't. |
|
But in simple cases, sure, why not? He said the context was a secondary school, so presumably we're not concerned with generalized family trees, just fairly simple relationships between students and their parents. |
| If you were designing a family tree, then yes, you might want something like that, that just tracks 'mother' and 'father' and infers all the rest of the relationships from that. Even in this case, that's probably the better way to go. I chose not to go into it because my point was simpler and the question wasn't specific enough to answer at much length. But I also wanted to suggest that when the original poster asked about "join tables," he was on the right track. |
|
But to simply informally track relationships in a general purpose application, a simpler, more practical solution should be employed. My "solution" is perfectly simple: given a table of people and an interest in which of them are siblings, record the facts of the sibling relationships in another table, once each. What could be simpler than that? In the context of a secondary school, presumably the "people" of primary interest are students and their parents, and as you note, the sibling relationships among students can be derived from the relationships among students and parents, and so a "siblings" table is unnecessary. Without knowing more about what the original writer really needs or wants to do, it doesn't seem helpful to hypothesize too much. But still, the basic idea of join tables and the principle of recording facts once each are sound. |
![]() |
| Thread Tools | |
| Display Modes | |
| |