Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Primary Key question
I am wondering if I could get some of your opinions on an issue that I have struggled with for quite some time. I seem to go back and forth on this issue.
I am using Visual Maxframe Professional and I am using the routines built in it for creating pk's for each table. Along with the pk's I generally have another unique ID.
Lets take a simple example...a customer file has both a pk field and an acctno field. I also have an invoice table with both a pk field and an invoice# field.
For each invoice there are multiple line item records. What I am curious about is whether I should put the invoice pk or the invoice# in the sold line item table and also if I should put the customer pk or the customer acctno field into the invoice table.
I know this is a pretty stupid question but since I have struggled with this quite a few times with other programmers I thought I would try to get anyone else's opinion.
Thanks,
Paul Acton
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