Primary key: Uniquely identifies a row. Usually an auto-incrementing integer or UUID. Every table needs one.
Foreign key: References a primary key in another table. Enforces referential integrity.
users: id (PK), name, email
orders: id (PK), user_id (FK → users.id), total
order_items: id (PK), order_id (FK → orders.id), product_id, quantity
Foreign keys prevent orphaned records. You can't delete a user who has orders (unless you cascade delete or set null).