Q
Problem solve Get help with specific problems with your technologies, process and projects.

Can a composite key contain the primary key from another table?

Can a composite key contain the primary key of a related table?

Can a composite key contain the primary key of a related table?
The columns that are used to make up a composite primary key must all come from within that table. You cannot use columns from another table.

However, you can store columns in your table that refer to values in another table, and use those columns in your composite primary key. So your table may contain columns COLA, COLB and COLC. COLB could be specified so as to enforce a Foreign Key constraint to another table.

You can create a composite primary key on COLA and COLB, while COLB is also participating in the relationship.

Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close