Jump to content

A difficult relation


edudna

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

Recommended Posts

How can we relate six tables that have a link relation parent::child5::child4::child3::child2::child1 in order child1 can show directly fields from its parent tables? To explain more what a user write to parent or child 5 or 4 or 3 or 2 to be shown directly in child 1. A form shown elements from six tables.

Pascal

Link to comment
Share on other sites

Ny guess here is that you're splitting tables wrongly here, can't be sure... but the structure seems to be in less than normalized state. If say each table is a years figures or such is it not normalized in a relational manner, but more a sort of structure build on accounting or management conventions.

In short do we need some indication of the data in hand ...this means here a list of the names you have given the tables if they follow something liked "years" but otherwise are indentical is it here the problem is.

--sd

Link to comment
Share on other sites

Here the order of the tables to help you understand as I can.

Ministry have peripherals.

Peripherals have administration(many Kind).

Administration have sub-administration offices.

Sub-administration have schools.

School have classes

Classes have sub-classes.

Sub-classes have students.

The Ierarchical tree of tables:

Ministry

Peripherals

Administration

Sub-administration

Schools

Classes

Sub-classes

Students

We want from a students layout to indicate fields from all above. Year is easy to display. How can be the relation of the tables? I have linked already with a foreign key all the above and they are in a chain relation.

Pascal

Link to comment
Share on other sites

What kind of info needs to get transfered? Or what does the term "indicate" mean here in your language? Honestly does it seem like just one table with persons position in the hierarchy as a single field chosen from a popup.

--sd

Link to comment
Share on other sites

I need to create a certificate-layout of a student after his or her school year attendance. In order to build this certificate-layout we need to use as a base the students table and show the name of the educational authorities like the name of the ministry, the name of the peripheral, the name of the school etc.... Fields that belong to the parent tables of the student.

I hope you can understand is not so complicated.

I found some ways like convert into global fields the related fields in the school table but I am not sure...

Pascal

Link to comment
Share on other sites

With all due respect to Soren's expertise on the theory of RDB, I think the structure is fine. I have a structure just like that although only down to Child2. At Child2 level, using the V8.5 passthrough relationships, I have no trouble getting data from the Parent. I suspect you have something wrong with your keys. Do you have unique keys for each record in each table? Are your relationships all One to Many descending? and Many to One ascending? ie each child has only one parent?

My Parent is Organisation and the Org Name is displayed in the other levels without a problem.

You aren't trying to use portals with data from multiple tables are you? That is a problem!

Link to comment
Share on other sites

I have no trouble getting data from the Parent

Neither would I except this exactly is a one-to-many recursive relational structure sometimes called the data-accordion, where each record beyond having an ID also have a stored keyvalue to the unit/person that the person sorts under, utilized in a selfjoin - so everything runs inside the same table, since the field structure in each of the 6 tables in question hardly differs particularly - I guess??

--sd

Link to comment
Share on other sites

I have discovered that it is possible to get data from the parent tables but the problem is that the fields in the parent tables pop-up values and in certificate do not. When I converted the fields in the certificate layout to pop-up values the problem solved. If you have any suggestion it is pleasantly acceptable too...

Link to comment
Share on other sites

If the structure is RIGID, i.e. each student belongs to a sub-class, and each class belongs to a class, etc. with no exceptions such as an administration belonging directly to a ministry instead of answering to a peripheral first, then there should be no problem with having a dedicated table for each, as described. To get the data on a layout of Student, you would simply place a related field from each ancestor table on the layout.

OTOH, unless the purpose of the solution is to track the administrative structure of the country's education system, one could say that the entire chain is an attribute of a school. So you could have a field in the Schools table that says:

The Ministry of Education

1st Circle Peripheral

Administration of Important Matters

Sub-administration for Bureaucratic Latency

all at once. How many ministries have schools anyway?

Link to comment
Share on other sites

Of course schools have one ministry but the ministry has six peripherals and a peripheral many administrations. I understand that to keep data for the ministry has no meaning and I am thinking to cancel it but it is an issue of order nothing else.

Link to comment
Share on other sites

then there should be no problem with having a dedicated table for each, as described

No of course not but why be bothered with the plentora of similar tables??

unless the purpose of the solution is to track

Yes this is the most important question what task does the simulation of the organizational structure do. What kind of data is stored in each of the tables?

--sd

Link to comment
Share on other sites

it is an issue of order

It is important to have order. The question is whether keeping this order is your businnes.

To illustrate the point: why not also have tables of Countries, Cities, Streets and Houses? Instead of entering a school's address, we will assign it to a house. The house has a parent in the Streets table, a grandparent in the Cities table and a grand-grandparent in the Countries table.

Then, in order to get the school's address, we could put something like this on our layout:

<>

<> <>

<> <>

<>

Mind you, this would work. But it makes no sense - unless you are running the post office.

Edited by Guest
This "feature" of inserting spurious spaces is ridiculous!
Link to comment
Share on other sites

To illustrate the point: why not also have tables of Countries, Cities, Streets and Houses? Instead of entering a school's address, we will assign it to a house. The house has a parent in the Streets table, a grandparent in the Cities table and a grand-grandparent in the Countries table.

:exactly:

--sd

Link to comment
Share on other sites

I do not dispute anything that you write.Really you release my mind. But for this case this afternoon I did this:

I create an occurence of schools table related to students table. So I created a foreign key for the schools table occurence and I made it a global Key. Then I put all the fields I want to certificate layout. It just need from a students record, to confirm the schools name and key and all the fields completed at once.

My database now is so reflexable to work with as many schools someone want. I did it!

Pascal

Link to comment
Share on other sites

My database now is so reflexable to work with as many schools someone want.

So you saw the beauty in recursive structures then, making it possible to make tiny exceptions on occation to the hierarchical flow or...???

What you can't with a straight forward parent-child-grandchild-greatgrandchild is sometimes to either flatten or even make the Kafka'ish maze deeper.

We had in our nation in the 1920 a vote in a part of the country ...wheather the part should remain part of Germany or should go with the etnicity of the majority ...the adminstrative procedures from the Reich times were however superiour and there where no-one really interested in making the newly adhesed part worsely adminstrated.

I know that such matters also applies to organizational charts, where some parts of the show easily can manage with out a staff function where others only exist due to this behaviour.

--sd

Link to comment
Share on other sites

This topic is 6300 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.