Q. What is foreign key ? How do you define a foreign key in your table?
Answer =
A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables. It acts as a cross-reference between tables because it references the primary key of another table, thereby establishing a link between them.
A FOREIGN KEY is a key used to link two tables together.
A FOREIGN KEY is a field (or collection of fields) in one table that refers to the PRIMARY KEY in another table.
Foreign key ( <column name>) REFERENCES <parent table name > ( < Column name > )
say in one line
ReplyDeleteFor understanding foreign key you read first two line.
DeleteAre you sure that you will understand the concept of foreign key in sine sentence and will be able to answer both the questions?
DeleteThanks . Nicely Explained both Parts.
ReplyDeleteWelcome 😊😊😊😊😊😊😊😊😊 All the best 👍👍👍👍👍👍👍👍
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )