Database Keys

Two types of key are used to access tables in a relational database: Primary Keys and Foreign Keys.

A Primary Key uniquely identifies a record in a table
A Foreign Key accesses data in some other related table via its Primary Key

Topics

Topic

Detail

See also

General Usage

In Enterprise Architect, Primary Keys and Foreign Keys are represented by stereotyped UML attributes and operations.

 

 

Example

The following example shows a data model that includes both Primary Key and Foreign Key columns.

A Physical data model defined using a UML Profile that includes Primary and Foreign Keys

A Physical data model defined using a UML Profile that includes Primary and Foreign Keys

 

 

Primary Key

In each table, one of the columns is designated as
the Primary Key, indicated by the
PK label beside the column, and a corresponding Primary Key Operation.

 

Primary Key

Foreign Keys

Foreign Keys are shown denoted by the FK labels.

 

Foreign Key

Association Notation

The Association that defines a Foreign Key relationship between
SalesPerson and Customer uses the Information Engineering notation; this is one of three
notations that Enterprise Architect  supports to help
Data Modelers distinguish cardinality in relationships.

Enterprise Architect also supports:

IDEF1X notation
UML notation

 

Data Modeling Notations

Learn more