Home  >  Article  >  Database  >  Entity integrity rules in RDBMS

Entity integrity rules in RDBMS

王林
王林forward
2023-09-17 13:41:021160browse

RDBMS 中的实体完整性规则

For entity integrity rules, each table has a primary key.

Primary keys cannot have NULL values.

##Student_IDStudent AwardStudent_Awards

Above, you can see that our primary key is

Student_ID . We cannot treat Student_Awards as a primary key because not every student will receive that award.

Let’s see another example -

##Employee_ID

Employee Name

Employee_Age

Employee Location

In the above table, the primary key is

Employee_IDNow let us summarize the entities Integrity rules -

ensure that every tuple in the table is unique.
  • Each table has a primary key, such as
  • Student_ID
  • of the Student table. Each entity is unique.
  • The relational primary key of each row must have a unique value.
  • Primary keys cannot have NULL values ​​and must be unique.
  • An example could be Employee_ID
  • in the Employee table cannot be empty.

The above is the detailed content of Entity integrity rules in RDBMS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete