API methods + binary link + M:M tables
Ruslan Zasukhin
sunshine at public.kherson.ua
Mon Jan 31 17:59:53 CST 2005
On 1/31/05 4:22 PM, "Olivier" <vidal_olivier at yahoo.fr> wrote:
> Hi Ruslan,
>
> I try to think only in navigationnal way to use the API methods.
> But in the following problem, I do not see how I can have an effective
> API code:
>
>
> I shall like knowing how much there is of persons having the same
> surname in every city. (Statistics).
>
> For example:
>
> PARIS:
>
> Name Counts
>
> name1 500
> name2 300
> name3 100
>
> (thus, there 100 persons at Paris having the surname "name3")
>
> BORDEAUX:
>
> name1 300
> name2 150
> name3 80
>
> ..............
>
> I think thus of having:
>
> - A city table (there are 36 000 cities)
> - A table of surnames (several thousand surnames)
> - A table (tbQuantity) making the link between the previous two tables
> AND having a field: "counts" ("counts"=Number of persons having this
> surname in a city)
I do not think you need COUNTS table.
I see only reason to have it, if you prepare some DB for CD and you want
optimize of for speed as much as possible.
If you develop regular db that will change runtime then I think this will
make things more complex then needed.
> - A binary link 1:M between the table "quantity" and the table "name"
> - A binary link 1:M between the table "quantity" and the table "city"
No no no.
All should be natural and mirror the real world entities.
> I think that it is necessary to make the third table (quantity) because
> of this field "counts".
>
> It is not maybe a good structure to use the API methods, but in that
> case, can we better make?
>
> Apparently, the best solution here are join them and SQL?
Aha! Look into ValentinaSQL.pdf
Here exists new group of "Link Methods".
It seems to me you need the function
COUNT( link_name, fld_B )
But I am not sure...
-----------------
Aha! Guys!
I think we need yet extend syntax of GROUP BY in the SQL to support Binary
Link. Because now there is no way to say
GROUP records of PERSON that are linked to some CITY
With ObjectPtr-link field we can do this grouping by ObjectPtr itself.
With binaryLink there is no such ability.
So we must have syntax as
Select
From
GROUP BY link_name
Sergey, Ivan, you see idea?
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina-beta
mailing list