what is primary key and foreign key?
Answers
Answered by
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!
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
80
Answer:
A primary key is either an existing table column or a column that is specifically generated by the database according to a defined sequence.
- 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 .
A foreign key is a column (or columns) that references a column (most often the primary key) of another table.
Similar questions