what's the right table structures for one-to-many forms?
eg. for invoicing, I use:
invoice.dbf
---------------
inv_no
inv_date
cust_id
inv_detail.dbf
------------------
inv_no -> foreign key of invoice.inv_no
stock_id
qty
price
while my friend insists the right way is:
invoice.dbf
---------------
inv_pk
inv_no
inv_date
cust_id
inv_detail.dbf
------------------
inv_fk -> foreign key of invoice.inv_pk
stock_id
qty
price
in his opinion, the key shoud be meaningless, not represent anything.
while my way (using invoice number) will cause lots of problem in the future, espesially with SQL databases.
please advise.
regards,
Jerry
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement