Follow these steps to create a Foreign Key Constraint in Oracle SQL Developer.
- Open Oracle SQL Developer and connect to the database.
- In the connection navigator, click on the Schema (user) node to expand.
- Then click on the Table node to expand.
- Find your table in which you want to create a Foreign Key and do the right click on it.
- From the shortcut menu select Constraint > Add Foreign Key.
- An Add Foreign Key window will appear.
- In the first field, it will show you the Schema (user) name.
- In the second it will show you the table name you selected.
- In the third field, specify the constraint name.
- Then select the column name from the source table.
- Then select the table name from the References Table Name drop-down list.
- Then select the column name in the Reference Table you chose above (in 11th step).
- You are all set, now click on the Apply button to create the foreign key. Below is an image for your reference.
See also:
- How to Create Table in Oracle SQL Developer?
- How to create a package in Oracle SQL Developer?
- How to export data from Oracle SQL Developer to Excel?