How to define a PK using Data Modeler?
A good “how to” article from Heli for those just getting started with Oracle Data Modeler. Don’t forget you get more good information like this from her new Oracle Press book on Amazon.com: Oracle SQL Developer Data Modeler.
Model on!
Kent
The Data Warrior
Primary Key (PK) identifies uniquely each row in a table. There can never be two tuples with same values in PK.
There are two ways of defining a PK: a natural key or a surrogate key. I would say that if you can find a natural key that is always better. But it is not always possible and therefore we can also use surrogate PKs. Surrogates are usually sequence numbers that has no meaning to the business people, the end users.
Let’s have an example of an entity for all the users in a company.
1. Defining a natural PK
What I want is that there will never be more than one user with the same username. If this means that there can NEVER be two with the same username, I would define the PK like this:
You can see the PK definition from Unique Identifiers tab:
And by clicking…
View original post 628 more words