What is foreign key and primary key?

1 answer(s)
[]

A primary key is a column that uniquely identifies every record in a table. Think of it as a unique ID, like a student number. No two records can have the same primary key value.

A foreign key is a column in one table that links to the primary key in another table. It essentially creates a relationship between them. For example, a CustomerID in an Orders table links a specific order back to the customer who placed it.