Computer Science
Answer
A non-key attribute, whose values are derived from the primary key of some other table, is known as foreign key in its current table. Defining a foreign key in a table involves specifying the relationship between the tables and setting up rules for data integrity. When two tables are related by a common column or set of columns, the related column(s) in the parent table (or primary table) should be either declared as a primary key or unique key. Meanwhile, the related column(s) in the child table (or related table) should have a foreign key constraint referencing the primary or unique key in the parent table.
Related Questions
Assertion. Both UPDATE and ALTER TABLE commands are similar.
Reason. The UPDATE command as well ALTER TABLE command make changes in the table.
What are different divisions of SQL and commands ? Give examples of commands in each division.
How is FOREIGN KEY commands different from PRIMARY KEY command ?
How is FOREIGN KEY commands related to the PRIMARY KEY ?