What is the difference between the Primary and Foreign key?

Answer Posted / suresh babu

Primary key and foreign key both are constraints.

Primary key:We can create only one primary key for a
table,which never allows the repeated or duplicate values
and null values.The index will be created when defining a
primary key.And primary key is used to make a relation
between more than one tables.

Foreign key:It allows the duplicate and null values.if we
want to make a relation between two tables,the parent table
column must have primary column and child table column
called foreign key.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql mysql pl sql oracle?

561


Can a foreign key be a duplicate?

499


What do you mean by rowid?

532


Is a view faster than a stored procedure?

540


What is consistency?

702






What is the largest value that can be stored in a byte data field?

516


What do you know by pl/sql cursors?

556


How to assign sql query results to pl sql variables?

504


How many sql core licenses do I need?

503


How to handle bulk data?

887


What is database white box testing and black box testing?

630


List out the acid properties and explain?

555


Which join is default?

513


How to run sql statements with oracle sql developer?

614


What is difference between stored procedure and trigger?

527