OCI Question:
Download Job Interview Questions and Answers PDF
What is the main difference between foreign key and primary key?
Answer:
primary key:- A primary contains unique and notnull.it means
a primary key column does not contain null values 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
a primary key column does not contain null values 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
Download OCI (Oracle Call Interface) Interview Questions And Answers
PDF
Previous Question | Next Question |
What is database normalization? | Tell me in function why return single value? |