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 ?
I would disagree with the concept that "the Primary Key (PK) is usually not the "Key" that is visible to user". In many cases, the end user can see the values in the PK column(s). It all depends on the PK constraint and the application, and the meaning of the PK value to the end user. If the PK is the EmployeeID number, then an employee looking at his or her record might want to verify the EmployeeID is correct. So the app can present it to the end user. Nothing wrong with that.
HTH,
Brian
-- =================================================================== Brian Peasland dba_at_nospam.peasland.net http://www.peasland.net Remove the "nospam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three" - UnknownReceived on Tue Sep 05 2006 - 10:14:12 CDT
![]() |
![]() |