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

Answer Posted / subbu

You cannot add foreign key after creation of the table until
unless you have assigned the primary key while creating the
table. I mean without a primary key assigned for a table, we
cannot add foreign key.

Once the primary key is found, then query to add is been
already given by the above posters.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is log shipping? : Sql dba

603


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

557


Why do we use set serveroutput on?

508


Is a foreign key always unique?

524


What is normalisation in sql?

542






What is trigger explain with example?

542


what are set operators in sql? : Sql dba

530


What are the types of sql commands?

544


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

766


What is application trigger?

533


What are the 3 modes of parameter?

675


Name three sql operations that perform a sort.

580


name 3 ways to get an accurate count of the number of records in a table? : Sql dba

560


How to run pl sql program in mysql?

505


Will truncate release space?

512