One to One relationship

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am developing a database to monitor the expense's of five differnt company
locations which have a ubique 3 digit identifier number. The invoices
genereated from each location have a unique invoice number so that will be
the one to many relationship. The invoices can only have one expense account
per invoice but i am unsure if this should be a one to one relationshsip or
one to many. The tables are:

LOCATION INVOICE ACCTS
LocID= Primary Key InvID =Primary Key AcctID =?

Would it be better to use autonumber for the relationship between ACCTS and
INVOICE?
 
If each invoice record can have only one account number, then you have a
one-to-one setup for that record. You should be able to use the AcctID value
in the ACCTS field, where AcctID is a foreign key to the primary key in the
Accounts table. No need for another autonumber field here.
 
To be clear on this, the autonumber is the primary key and the AcctId is the
foreign key in the account table?
 
That certainly is one way of setting up a 1-to-many relationship, yes --
assuming that the autonumber field is the primary key in the "parent" table.
Be sure to set the data type of the AcctID field in the "child" table to
Number - Long Integer.
 
Back
Top