Primary Key (Entity Relationship Diagram)

A primary key uniquely specifies a row of data specified by the entity.

A primary key (usually abbreviated as PK) is a unique identifier for a set of tuples defined for the entity.

A primary key can be a single attribute or a set of multiple attributes.

Primary Key Symbol

The primary key can be depicted using one of these three styles:

  • Plus (+)
  • Abbreviation (PK)
  • Key Icon (🔑)

The attributes of the primary key are rendered with bold.

Primary Key Example

In the real world, if the entity is an apartment, the primary key can be the number of the apartment.

Primary Key of ERD Entity Example
Primary Key of ERD Entity Example

How to Set Primary Key for ERD Entity

You have various options how to set primary key to an ERD entity:

  • Right-click on the ERD entity attribute and choose Primary Key from the context menu
  • Select an ERD entity attribute and click on the Primary Key button in the ribbon / Field tab / Modifiers group.
  • Edit the ERD entity attribute text in the diagram editor and type + before the attribute name
  • Open the Properties dialog for the ERD entity (choose Properties from the context menu after right-clicking the ERD entity), switch to the Attributes tab, and check the PK check box for the attribute (or attributes) that should be the primary key for the entity.
You can check out this tutorial about setting the primary key.
Set the primary key using the context menu
Set the primary key using the context menu

New Comment

Comment