What is the difference between the Primary and Foreign key?

Answer Posted / dhirendra

Primary Key: This is a constraint which is always unique &
not null.

Foreign Key: This is a constraint which is just opposite to
Primary key. It can be not Null & can accept duplicate value
as well. Foreign key points to same table's primary key or
another table's primary key to make a relationship.

Is This Answer Correct ?    12 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are sql*plus environment variables?

772


Can we insert data in view?

691


what tools available for managing mysql server? : Sql dba

745


How to start oracle sql developer?

751


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

787






What are the three pl sql block types?

719


What port does sql server use?

707


What is sql trigger example?

751


What is the difference between nvl function, ifnull function, and isnull function?

794


Can we declare a column having number data type and its scale is larger than pricesionex: column_name number(10,100),column_name numbaer(10,-84)

722


How do I enable sql encryption?

713


What are the features of pl sql?

766


Can we insert data into view?

678


What does count (*) mean in sql?

1291


Why is theta join required?

834