Foreign Keys

A foreign key is a table key column that is dependent on a column set in another table. Foreign-key column data must match the specified column data in the table that the foreign key depends on.

A foreign key is a set of columns of one table whose values are required to match the values of some column set of another table. The column set of the table on which the foreign key depends need not constitute an explicitly defined primary key, but it must be unique in that each item of row data defined on the specified columns is unique for the table.

For example, if TABLE_A has a primary key defined for the column COL_1, then no two rows in TABLE_A have the same values in COL_1. Because of this uniqueness property of COL_1, a foreign key can be defined in TABLE_B for the primary key in TABLE_A. If TABLE_B defines a foreign key constraint for COL_3 using the primary key in TABLE_A, the values in TABLE_B.COL_3 must match the values in TABLE_A.COL_1.

Related tasks
Creating a Foreign Key
Editing a Foreign Key
Dropping a Foreign Key

Send your feedback on this help topic to Sybase Technical Publications: pubs@sybase.com

Your comments will be sent to the technical publications staff at Sybase, Inc. For product-related issues or technical support, contact Sybase Technical Support at 1-800-8SYBASE.