To create a foreign key using the inline constraint syntax, use a command like this: CREATE table_name (Ĭolumn_name data_type REFERENCES other_table_name (other_column_name) I’ve documented them both in my guide to the CREATE TABLE statement here and I’ll explain them in this article for you. There are two ways to create a foreign key on a table in Oracle: the inline method and the out-of-line method. It’s used to relate data in two tables and improve the integrity of your data. It allows you to specify that a column in a table refers to the primary key of another table. What Is a Foreign Key?įirst, let’s explain what a foreign key is.Ī foreign key is a constraint that’s added to a table. In this article, I’ll explain how to create a foreign key on a table in Oracle SQL.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |