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  > )

5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. say in one line

    ReplyDelete
    Replies
    1. For understanding foreign key you read first two line.

      Delete
    2. Are you sure that you will understand the concept of foreign key in sine sentence and will be able to answer both the questions?

      Delete
  2. Thanks . Nicely Explained both Parts.

    ReplyDelete
    Replies
    1. Welcome 😊😊😊😊😊😊😊😊😊 All the best 👍👍👍👍👍👍👍👍

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post