what is thae main difference between foreingkey and
primarykey
Answer Posted / nageswararao.k
primary key:- A primary contains unique and notnull.it means
a primary key column does not contain nullvalues and
duplicates.A table containe only one primary key.using this
we can access the data from table easily.
foreign key:-a fk can contain duplicate values but it not
contain null values.using fk to establish relationship
between two tables. a parent table primary key should be
referenced by child table primary key.
one fk should be referenced by only one primary key
the main difference between two keys is
pk is used to access the data from table.
fk is used to establish the relationship between two tables.
pk does not allowed duplicate and null values.
fk can allows duplicate values and does not allowed null
values
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers