General Concepts

Primary and foreign keys

Definition

The primary key uniquely identifies each row in a table and doesn't allow nulls or duplicates. The foreign key is a column that references another table's primary key, which creates the relationship and enables referential integrity.

Exam context

In DP-900 it comes up when describing relational data: in Orders, CustomerId is a foreign key to Customers. Along with views, indexes, and stored procedures, they are common relational database objects and concepts.

Studying for the DP-900?

Primary and foreign keys is a concept that can show up on the exam. Check the full guide to see it in context.