Press "Enter" to skip to content

How to Create Foreign Key in Oracle SQL Developer?

Follow these steps to create a Foreign Key Constraint in Oracle SQL Developer.

  1. Open Oracle SQL Developer and connect to the database.
  2. In the connection navigator, click on the Schema (user) node to expand.
  3. Then click on the Table node to expand.
  4. Find your table in which you want to create a Foreign Key and do the right click on it.
  5. From the shortcut menu select Constraint > Add Foreign Key.
  6. An Add Foreign Key window will appear.
  7. In the first field, it will show you the Schema (user) name.
  8. In the second it will show you the table name you selected.
  9. In the third field, specify the constraint name.
  10. Then select the column name from the source table.
  11. Then select the table name from the References Table Name drop-down list.
  12. Then select the column name in the Reference Table you chose above (in 11th step).
  13. You are all set, now click on the Apply button to create the foreign key. Below is an image for your reference.

create foreign key in Oracle SQL Developer

See also: