Jump to content

The best relationship to three tables...


edudna
 Share

This topic is 5768 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Let we have three tables,

Table one is groups that only have six records display six groups of costumers. There are two more tables one for subgroups and one for customers. One group may have one, two or three subgroups. A costumer belongs to one group and to one subgroup. For example a costumer may belongs to group A and to 1 subgroup called A1...

Table 1

GroupID

GroupName (there are only, a,b,c,d,e,f)

Table 2

SubgroupID

SubgroupName

GroupForeignID

Table 3

CostumerID

First name

Second name

SubgroupForeignID

GroupForeignID

How can I do the best relationship in order the three tables work together in the right way?

Pascal

Link to comment
Share on other sites

FileMaker shows a many-to-many because it doesn't yet know which is the parent side and which is the child side. When you make the primary keys auto-enter serial numbers (or defined as Unique) they will change to one-to-manys.

You'll still need to add another TO (table occurence) of the Subgroup table and link that Subgroup TO to Customer via SubgroupID.

Also, you have your primary key names starting with a "g". Field names starting with a "g", like "gMyField", is a naming convention that indicates the field is defined with global storage. In this case, your primary and foreign keys would not be globals, so you should probably fix those names.

Link to comment
Share on other sites

As I understand I have started Filemaker in the opposite way.First I built the database, then I have to learn the software how it is works... I am learning fast I think since I have started before twenty days. But I like Filemaker anyway. Thank you for your response.

Pascal

Link to comment
Share on other sites

A costumer belongs to one group and to one subgroup.

Perhaps I am missing something, but it seems that once you assign a customer to a subgroup, the group is known. So there's no need for a direct relationship from Customers to Groups, and the field Customers::GroupID is redundant.

From the point-of-view of user interface, it might be convenient to select the customer's group first, then choose from the available subgroups. That would require a second relationship from Customers to Subgroups:

Customers::GroupID = Subgroups 2::GroupID

But this a purely auxiliary relationship. Moreover, one should take care to avoid a possible contradiction between the selected group and the subgroup of a customer.

Link to comment
Share on other sites

When a user in the costumers' record indicate the group of the costumer, the subroups of the particular group should be shown automaticaly in the subgroup field and not all the subgroups. How can this be done? When a costumer indicate the subgroup it should indicate the group at once and it does not need of the user to complete both fiels. I hope you understand.

Pascal

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 5768 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.