Computer Science, asked by thapaashishkum6833, 1 year ago

Defferent between foreign key and primary key

Answers

Answered by Venkatasubbu
0
A primary key is a column or a set of columns that uniquely identify a row in a table. A primary key should be short, stable and simple. A foreign key is a field (or collection of fields) in a table whose value is required to match the value of the primary key for a second table. ... A table can have multiple foreign keys.
I hope this helps u
Pls comment
Answered by piyushranjan1313
1
Primary Key and Foreign Key

Primary key uniquely identify a record in the table. Foreign key is a field in the table that is primary key in another table.

Primary Key can't accept null values. Foreign key can accept multiple null value.

By default, Primary key is clustered index and data in the database table is physically organized in the sequence of clustered index.

Foreign key do not automatically create an index, clustered or non-clustered. You can manually create an index on foreign key.

We can have only one Primary key in a table. We can have more than one foreign key in a table.
Similar questions