Re: euEDB / euSQL primary key problem
- Posted by duke normandin <dnormandin at bsdrocksperlrolls.com> Feb 18, 2007
- 541 views
Matt Lewis wrote: > > duke normandin wrote: > > > > hey.... > > > > I need to have both keys in a 2-key table form a "composite" primary key. > > Can't > > seem to be able to convince euEDB to accept that scenario. Anybody know if > > this > > feature is supported in euEDB / euSQL ? > > > > Example: > > > > Students Table Participants Table Activities Table > > > > Name | ID* ID* | Activity* Activity* | Cost > > > > You see how the fields in the "Participants" table are really "foreign" keys > > that _together_ constitutes the table's unique key? TIA... > > You need to put ID and Activity into a sequence, and make that the key. > For eusql, you'd need to make them 'sub-fields.' > > PK.ID > PK.Activity > > Matt hey.... This query passed as well AND worked....... SELECT STUDENTS.NAME FROM STUDENTS INNER JOIN PARTICIPANTS ON STUDENTS.ID=PARTICIPANTS.PK.ID WHERE PARTICIPANTS.PK.ACTIVITY='Swimming' Go figure! I must have set it up correctly ;) I should crank out a mini-HOWTO eventually on database normalizing and setting up euSQL via "edb" and manually as well I suppose. Thanks! -- duke SW of Calgary - near the Rockies http://www.rootshell.be/~perlster/euphoria/