what is the difference between primary key & foreign key?

Answer Posted / gaurav , ashish ,preeti , main

Primary key is used to identify a row in a table and it
doesnot allow null values. It avoids duplication of rows.

whereas foreign key refers to a column or combination of
columns included in the defenition of referential integrity

Is This Answer Correct ?    57 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe varray?

574


Give the constructs of a package, function or a procedure.

527


How to return top 5 rows in oracle?

531


What is control file used for?

594


What is a data lock in oracle?

601






Using the relations and the rules set out in the notes under each relation, write table create statements for the relations EMPLOYEE, FIRE and DESPATCH. You should aim to provide each constraint with a formal name, for example table_column_pk.

1346


What is oracle instant client?

554


What are the general rules on data consistency?

576


src name sex a,male b,female c,male d,female Required output : male female a,b c,d tried pivot but was not successfull select * from src pivot (max(name) for sex in ('MALE','FEMALE'));

1172


Where do we use decode and case statements?

546


How to connect to a remote server?

543


Does facebook use oracle?

558


How to list all indexes in your schema?

569


How to speed up webrick?

582


What privilege is needed for a user to insert rows to tables in another schema?

550