How do you specify a foreign key in Oracle?
Chapter7: User Creation And Management
Section: Chapter Questions
Problem 3RQ
Related questions
Question
How do you specify a foreign key in Oracle?
Expert Solution
Step 1
Foreign Key:
- A foreign key is a method to apply referential integrity within user Oracle database.
- It is a key used to connect two tables together.
- It is a field in one table that refers to the primary key in alternative table.
- It means a column in one table whose values equal the primary key in another table.
Specifying foreign key in Oracle:
- In Oracle, a foreign key can be specified in "ALTER TABLE" command.
- When a table have a foreign key, user can identify the foreign key by using "ADD FOREIGN KEY" clause of the "ALTER TABLE" command.
- In this clause, user specify the column that is a foreign key and the table it matches.
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr