Understand the role and properties of a primary key.
A Primary Key is one of the most important concepts in the relational database model. Its primary purpose is to uniquely identify each record (or row) in a database table. Think of it as the social security number for each record; no two records in the same table can have the same primary key value. This uniqueness is its defining characteristic. A primary key is chosen from a set of one or more 'candidate keys'. A candidate key is any column or set of columns that can uniquely identify a row. The database designer selects one of these candidate keys to be the primary key. There are two main rules that a primary key must follow. First, it must contain unique values for each row in the table. Duplicate values are not allowed. Second, it cannot contain NULL values. Every record must have a value for its primary key. This is known as the entity integrity constraint. A table can have only one primary key, which can consist of a single column (a simple key) or multiple columns (a composite key). For example, in a 'Students' table, the 'student_id' would be an excellent choice for a primary key. By enforcing uniqueness, primary keys prevent duplicate records and provide a reliable way to access and reference specific rows, forming the foundation for creating relationships between tables.