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

how to drop an existing index in mysql? : Sql dba

539


What is minus?

546


Explain the insert into statements in sql?

565


What is keys and its types?

542


Is nosql faster than sql?

542






First round ------------------- - Procedure - Packages - Views - Virtual tables - Can we use dcl with in function? - Joins and few scenarios - Triggers and its type - Pragma, type and its functionality - How to create db link in oracle - Materialized view - How to find duplicate values from table? - Cursor and its functionality - Write a script to display friday and its date from a entire year. - Exception Handling Second round ------------------------ Gave a scenario like. Need to write a function to perform. When user try to change a password. It must not be last five password and a given password can be combination of characters, symbols, upper and lower case.

1141


Explain the difference in execution of triggers and stored procedures?

569


Do we need to rebuild index after truncate?

529


What do you understand by case manipulation functions?

545


Do ddl statements need commit?

540


Write the alter statement to enable all the triggers on the t.students table.

672


Does sql between include endpoints?

552


Is pl sql useful?

539


What is the difference between cluster and non-cluster index?

618


What is %type in sql?

513