Jump to content

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

Recommended Posts

Posted

Hi,

How would you conceptualize a zero-to-many self-join?

In my case, I need to create a database that contains cities.

Some cities have boroughs others none and some boroughs have areas and others none.

Do I create three distinct tables or I create a single table with a parent field in it?

Posted

This is a very tricky subject. What you have essentially is a location which can be comprised of other locations, which in turn can be comprised of still more locations. It's a recursive data structure and they're easy to implement but difficult to work with in FMP, typically because layouts aren't dynamic.

Depending on what you want to do with these locations, you can either create specific tables for each location type, or you can use a single table and configure a recursive relationship between the table and itself.

Using some of the techniques available elsewhere you can present recursive data structures as a collapsable tree structure.

Posted

To this structure, I will attach a street table which can belong to one of the three entities (city, borough or area).

The maximum number of recursion is 3.

I already developed the structure with 3 different tables a few years ago, but the problem is that when a city was by itself, I needed to replicate the record in the borough table and the area table so the street would be attached to the right city. In FM 8, it was quite awkward for the user. Now with FM10, it could be different with the event handling.

This topic is 5746 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
×
×
  • Create New...

Important Information

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