Question: what is the difference between primary key and foreign key in sql with example?
Answer: Primary key is used to identify data uniquely therefore two rows can't have the same primary key. It can't be null. On the other hand, foreign key is used to maintain relationship between two tables.