What is a foreign key constraint used for in a database table?

  • Defines a link between a column in one table and a column in another table
  • Enforces uniqueness in a column
  • Ensures data in a column is not NULL
  • Sets a default value for a column
A foreign key constraint in a database table is used to define a link between a column in one table and a column in another table. This establishes referential integrity, preventing inconsistent data by ensuring that values in the foreign key column match those in the referenced primary key column.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *