Skip to Main Content

APEX

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!

Should i create Primary or Foreign keys first?

809712Nov 2 2010 — edited Nov 2 2010
I am new to sql and a student so please bear with me.

I am creating a script so that when i run it a sequence of tables are created. I have created all my tables fine but now i want to add the primary and foreign keys. I tried to do this all in one go before but had problems, my idea was to use alter table statements and add the constraints of primary and foreign keys in that way.

The thing i want to know is what to create first? Do i do all the foriegn keys then primary keys or visa versa? Or do i do them sequentially and connect the relationships between the tables as i go. Thanks in advance!
This post has been answered by 345641 on Nov 2 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 30 2010
Added on Nov 2 2010
5 comments
787 views