They way I operate is to start with an account, though this normally lines up one to one with a customer or supplier. Suppliers can also be customers.
Using this logic there must me at least one contact, the person you pay or who pays you. The company has the PK the contact a FK. There is little information in the companies table. It holds things like; reference (PK), your account number, their account number, Company name, YTD sales, YTD purchases, cost of sales, credit limit , outstanding balances.............etc. The meat is in the contacts table; reference (FK) referenced to accounts table, contact reference (PK), name, address and so on. So if you are trading with a one man band there is one entry in the accounts table and one in the contacts. If it is a larger company there is still 1 account and many contacts. Looking at an order placed on yourself it could be placed by any number of contacts working for a given company. You would invoice the account sending the invoice to the accounts department in the case of the larger company referencing the purchase to the named contact otherwise the contact in the case of the one man band. Purchases are recorded in a similar manner. When processing orders it is the contacts reference that appears in the order header not the company. Same goes with purchase orders. Ian At 14:24 15/04/02 +0300, you wrote: >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 > >================================================ >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/ ================================================ 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/
