Computer Science, asked by ariba19, 1 year ago

what is primary key and foreign key?​

Answers

Answered by sarbani15
32
Primary Key -
A primary key is a key in a relational database that is unique for each record.

Foreign Key-
In relational databases, a foreign key is a field in one table that
uniquely identifies a row of another table or the same table.

Hope that helps!
Answered by simran7539
80

Answer:

</p><p>\huge{\underline{\underline{\sf{\red{Primary \: Key :-}}}}}</p><p>

A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence.

</p><p>\huge{\underline{\underline{\sf{\red{Properties\: of \: Primary \: Key :-}}}}}</p><p>

  • It should always store some values .No bull values are allowed in primary key fields.
  • It should store unique value.
  • Once decided, the value must not change as long as that record remains in the database .

</p><p>\huge{\underline{\underline{\sf{\red{Foreign \: Key :-}}}}}</p><p>

A foreign key is a column (or columns) that references a column (most often the primary key) of another table.

Similar questions