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 the usage of distinct keyword?

606


How do I run a script in sql developer?

472


What is the location of pre_defined_functions.

619


How do you select unique values in sql?

483


what is the difference between undefined value and null value? : Sql dba

518






What do you mean by stored procedures? How do we use it?

498


How do I send sql query results to excel?

543


Which sql statement is used to return only different values?

483


What is a memo field?

502


What are the advantages of pl sql over sql?

517


What trigger means?

544


Any attempt to navigate programmatically to disabled form in a call_form stack is allowed?

560


What is dialect in sql?

509


what is the different between now() and current_date()? : Sql dba

500


What is serial sql?

503