Primary key is uniquely identified record in the table, foreign key is a field that is primary key in another table, and Example is a student ID in the main table is primary key, in other words, it cannot be repeated. The foreign key is connected with the primary key in another table.