Rachael, Thank you for the response. The question was how many times or how far do you put a foreign key. I know a foreign key go in the invoice header but Would you put a foreign key in the Invoice details from the project and customer? If a customer name or project was deleted, then a trail would be found. I understand keys now. thanks,Boyd
My next question is how to get 2 tables on a form? ---- Rachael Malberg <[EMAIL PROTECTED]> wrote: > Oh sure and did you know you can have Primary and mulitple Foreign Keys with > in the same table? The idea is you have only 1 primary key value in a parent > table and it is used to 'relate' that record to the child table record. the > child table may have it's own PK, because it too maybe a parent table to > another table, and it would have a FK 'relating' it to the parent table > > This is part of your Database Model and there are lots of book on Database > Modeling. > > In your example you could do something like > Customer with PK CustID > Project (which maybe the same as the TransHeader) with PK ProjectID and > FK CustID > ProjectRoom (TransDetail) w/ PK ProjRmID and FK Project ProjectID > ProjectRoomElements w/ PK ProjRmElID and FK ProjRmID > > If this sounds way to confusing and this is a database that is pertinant to > your business I would advise hiring a developer. An uptomized and true > relational database for a business is not easy to do and since it is the > back bone of any application, a good one makes things work great, a bad > one...well not so great. > > For a list of RBase developers go to http://www.rbase.com/developers/ . I > think I can speak for all of us in saying, we would love to be of any > assistance. > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: "RBASE-L Mailing List" <[email protected]> > Sent: Wednesday, April 30, 2008 12:19 PM > Subject: [RBASE-L] - Re: Primary or Foreign Keys > > > > Razzak or anyone else, > > > > I am writing an interior design program. > > Would it be over-kill to have multiple foreign keys: > > > > customer- > > primary to project > > foreign to room/transaction header/transaction details > > > > project- > > primary to room > > foreign to elements/transaction header/transaction details > > > > a quick search could come up with each details. > > > > Thank you, > > Boyd > > > > ---- "A. Razzak Memon" <[EMAIL PROTECTED]> wrote: > >> At 05:24 PM 4/28/2008, [EMAIL PROTECTED] wrote: > >> > >> >Razzak, > >> > > >> >I did read your article so for a primary key: > >> >not null or dup. value > >> >enforces constraints, > >> >use instead of rules > >> >builds an index. > >> >So all others will be foreign keys. > >> > > >> >Correct? > >> > >> Very correct, Boyd! > >> > >> To further understand the PK-FK relationship and a typical > >> relational database model, take a look at the latest RRBYW14. > >> > >> CONNECT RRBYW14 > >> > >> At the R> Prompt: > >> > >> SET LINES 0 > >> LIST PKEYS > >> LIST FKEYS > >> LIST CONSTRAINTS > >> > >> Very Best R:egards, > >> > >> Razzak. > >> > > > > > --- RBASE-L ================================================ TO POST A MESSAGE TO ALL MEMBERS: Send a plain text email to [email protected] (Don't use any of these words as your Subject: INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH, REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP) ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: INTRO ================================================ TO UNSUBSCRIBE: Send a plain text email to [email protected] In the message SUBJECT, put just one word: UNSUBSCRIBE ================================================ TO SEARCH ARCHIVES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: SEARCH-n (where n is the number of days). In the message body, place any text to search for. ================================================

