Answers

Question and Answer:

  Home  OCI (Oracle Call Interface)

⟩ What is the main difference between foreign key and primary key?

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

 131 views

More Questions for you: