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 ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is your daily office routine?

1986


what are wild cards used in database for pattern matching ? : Sql dba

754


Show the two pl/sql cursor exceptions.

805


What is a loop in sql?

740


How is data stored on a disk?

726






which command using query analyzer will give you the version of sql server and operating system? : Sql dba

700


Does a user_objects view have an entry for a trigger?

755


Can you inner join the same table?

708


What are the different sql commands?

721


How to rename a table?

762


What is the difference between sql and t sql?

715


How can I tell if sql is running?

761


what is a stored procedure? : Sql dba

783


What is %type in sql?

691


Is it possible to update views?

708