Hi Kontos, You did not give enough information to advice you.
Tables CUSTOMERS and REPRESENTATIVES have one-to-many connection by CUST_ID. You should have CUST_ID column into REPRESENTATIVES table. You should have at least one row into REPRESENTATIVES table for everyone customer. If you do not have, just put some data from CUSTOMERS into REPRESENTATIVES for that certain row. Next step will be to connect PAYMENTS table with REPRESENTATIVES by REPR_ID column. This connection will be one-to-many. You do not need in PAYMENT(S) table columns KIND_ID and WHO_ID! This technik is known as �build an additional table between two tables�. Having representative for everyone customer will solve the problem in accordance with first, second, and third normalization forms for these three tables. Konstantin Gudjev >From: "ELOEN" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: <[EMAIL PROTECTED]> >Subject: Design subject >Date: Mon, 15 Apr 2002 14:24:34 +0300 > > >Table CUSTOMERS (CUST_ID,...), table REPRESENTATIVES (REPR_ID,....) with >1:m >(optional) relation > >so 1 customer may have none,1 or many representatives > >there is also table PAYMENTS > >now what is the best design according to normalization: > >1. PAYMENT (PAYMNT_ID,KIND_ID,WHO_ID,..) >with KIND_ID = 'C' for CUSTOMERS, 'R' for REPRESENTATIVES) >and WHO_ID = CUST_ID or REPR_ID respectively > >2. tables PAYCUST (PAYCUST_ID,CUST_ID,...) and PAYREPR >(PAYREPR_ID,REPR_ID,..) for each group of data > >never managed to solve this > >TIA > >P.Kontos >Athens, Greece _________________________________________________________________ Join the world�s largest e-mail service with MSN Hotmail. http://www.hotmail.com ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
