Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Why do we use Meaningful PK or Meaningless PK ?
krislioe_at_gmail.com wrote:
> Hi All,
>
> My questions below is very basic (I am a developer not a dba ..)
>
> I see on database design that the Primary Key (PK) is usually not the
> "Key" that is visible to user, e.g : if we has Invoice table, the
> columns are :
>
> InvoiceID (PK) => this is only visible to developer, user never see it,
> usually
> using sequence.
> InvoiceNumber => this is visible on UI, reports etc
> ....
> >From the design point of view, what is the reason of the above design ?
>
Maybe it's just that from a programming point of view it is extremly handy to uniquely identifiable records. (It's not always an absolute must, but it makes life easier in a lot of cases.) On the other hand, humans often don't care for uniquely identifyable records. There may be no strict uniqueness requirement on certain datasets.
As for your example: IF the InvoiceNumber is really unique, it would also make sense from an application dev point of view to use it as PK.
best,
Martin
Received on Tue Sep 05 2006 - 15:52:55 CDT
![]() |
![]() |