Question:

Which of the following is correct syntax for inserting foreign key constraint in a relation?

Updated On: Nov 4, 2024
  • ALTER TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
  • ADD TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
  • ALTER TABLE table_name REFERENCES referenced_table_name(attribute_name) ADD FOREIGN KEY(attribute_name)
  • MODIFY TABLE table_name ADD FOREIGN KEY(attribute_name) REFERENCES referenced_table_name(attribute_name)
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

The correct syntax for adding a foreign key constraint is through ALTER TABLE, adding a FOREIGN KEY and referencing another table.
Was this answer helpful?
0
0