Computer Science, asked by imuskanmishra, 9 months ago

What is the relationship and difference between a primary and foreign key?

Answers

Answered by pavithranatarajan855
1

Answer:

PRIMARY KEY:

It cannot be NULL.

Only one primary key in the table.

In each row it is unique.

example:student_id

FOREIGN KEY:

It can Null values.

Any number of foreign key in the table.

It is used to link two table.In one table it is the primary key and another table it is not.

Explanation:

Answered by dhruvpatil4555
1

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. Primary of a table act as forgein key in the other table.

Please mark me as brainliest

Similar questions