Let us understand all the details with respect to Primary Key Constraints.
- There can be utmost only one Primary Key in a given table.
- Primary Key enforces uniqueness and also values in the Primary Key Column(s) should not be empty. To make sure, values are not empty NOT NULL constraint is enforced over Primary Key Columns.
- Primary Key Contain one or more columns in a table. If there are more than one column then it is called as composite key.
- If the Primary Key have only one column and if the column is populated by Sequence then it is known as surrogate key.
- Surrogate key values will not have any significance from the business context and typically not used directly any where in the application.
- We can define Foreign Key Constraints in Child Tables using Primary Key or Unique Constraints in the table.
- An index will be created when we define Primary Key to sort the data and enforce uniqueness.
Click here to go to the topic where we have links for all the important Database Concepts.