El_Pablo Posted June 3, 2009 Posted June 3, 2009 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?
corn Posted June 4, 2009 Posted June 4, 2009 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.
El_Pablo Posted June 4, 2009 Author Posted June 4, 2009 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now