How to add Foreign key in a table after the creation of the
table?

Answer Posted / devi

alter table table2
add(constraint table2_col2_fk foreign key(col2) references
table1(col1);
here col2 is the foreign key of table2 which refer to the
col1 of table1 which is h epimary key of table1

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is primary key in db?

521


How do I view tables in sql developer?

516


what is try_catch block in procedure

1192


What are the different type of joins in sql?

544


What is the difference between distinct and unique in sql?

474






What is scope and visibility in PL/SQL?

598


What is a full join?

530


How do I find duplicates in two columns?

552


what are aggregate and scalar functions? : Sql dba

552


What is multiple partition?

539


What is a sql trace file?

550


Do prepared statements prevent sql injection?

530


Can a trigger call a stored procedure?

536


What is difference between left and right outer join?

526


Explain the purpose of %type and %rowtype data types?

503