Computer Science, asked by karanbisht745, 9 months ago

what is primary key ? how it is different from foreign key? ​

Answers

Answered by pappuboe1979
6

A primary key is a coloum or a set of coloum that uniquely indentfy a row in table . A primary key

should be short table and simple . A foreign key is a field ( or a collection of field ) in a table whose value is required to match the value of primary key for a second table........ A table can have multiforeige key.

Hope it's help you

Answered by Anonymous
54

Answer:

Hey there !

Explanation:

Primary key is a special relational database table column or a combination of multiple columns that allows to uniquely identity all table records.

Primary key is different from from foreign key:

1. Primary key can not accept null value while foreign key accept multiple null value.

2. There is only one primary key in a table while there is more than one foreign key in a table.

3. Primary key does not accept duplicate value while foreign key attribute does contain the duplicate value.

4. Primary key is clustered index while foreign key is not clustered index.

5. Primary key constraint can be applied temporary tables while foreign key constraint can not be applied temporary tables.

Hope it helps you.

Similar questions