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

Answer Posted / sagar98

ALTER TABLE <table_name>
ADD CONSTRAINT <fk_name> FOREIGN KEY (column_name)
REFERENCES <table_name_where_this_column_acts_as_PK>
(Column_name)

Is This Answer Correct ?    19 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the 'mysql' command line arguments? : Sql dba

652


In pl/sql, what is bulk binding, and when/how would it help performance?

535


Can we join two tables without common column?

516


How do you update f as m and m as f from the below table testtable?

1084


What is difference between procedure and trigger?

519






What is pl sql block structure?

544


What does stand for in sql?

524


What are triggers in sql?

582


how to extract a unit value from a date and time? : Sql dba

556


How much does sql certification cost?

548


Is mariadb nosql?

586


What is compilation error in pl sql?

504


What does select * from mean in sql?

1994


Explain constraints in sql?

574


What are procedures used for?

529