Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is referencing column name optional in foreign key constraint? If so, how does oracle which column to reference to?

Hello everyone.

I am studying a Oracle SQL on udemy, the instructor created a child table that has foreign key constraint. In the foreign key constraint, he did not specify the primary key column of the parent table. He only referenced the parent table, not the column.

So my question is, is referencing the primary key column of the parent table in the foreign key constraint optional? which seems to be so, if that is the case, does Oracle just use primary key column of the parent table as the referenced column in the foreign key constraint automatically?

This post has been answered by mathguy on Sep 7 2023
Jump to Answer
Comments
Post Details
Added on Sep 7 2023
3 comments
89 views