limited time offer

Can a foreign key contain null or duplicate value ?

Yes, Foreign key contains null value or duplicate value. A foreign key containing null values cannot match the values of a parent key, since a parent key by definition can have no null values. However, a null foreign key value is always valid, regardless of the value of any of its non-null parts.

You can have multiple foreign keys on the same table. Unlike primary keys, foreign keys can contain duplicate values. Also, it is OK for them contain NULL values. Indexes aren't automatically created for foreign keys; however, as a DBA, you can define them. A table is allowed to contain more than one foreign key.