If I create ‘Student’ field in ‘Fees’ table to store ‘student_id’ of ‘Students’ table, then this ‘Student’ field in ‘Fees’ table is called: A. Foreign key B. Native key C. Composite key D. Primary key

Foreign key
Native key
Composite key
Primary key

The correct answer is A. Foreign key.

A foreign key is a field in one table that refers to the primary key of another table. In this case, the ‘Student’ field in the ‘Fees’ table refers to the ‘student_id’ field in the ‘Students’ table. This is because the ‘Fees’ table stores information about fees that are paid by students, and each fee is associated with a specific student.

A native key is a primary key that is not a foreign key. A composite key is a primary key that is made up of two or more fields. A primary key is a field or group of fields that uniquely identifies each row in a table.

Here is an example of a foreign key:

| Table | Field |
|—|—|
| Students | student_id |
| Fees | student_id |

In this example, the ‘student_id’ field in the ‘Fees’ table is a foreign key because it refers to the primary key of the ‘Students’ table. This means that each row in the ‘Fees’ table must have a value in the ‘student_id’ field that matches a value in the ‘student_id’ field of the ‘Students’ table.

Exit mobile version