MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

SQL

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A primary key of one table is known as a ____ key in other tables:
A
foreign
B
unknown
C
related
D
unique
Explanation: 

Detailed explanation-1: -In a foreign key reference, a link is created between two tables when the column or columns that hold the primary key value for one table are referenced by the column or columns in another table. This column becomes a foreign key in the second table.

Detailed explanation-2: -A FOREIGN KEY is a field (or collection of fields) in one table, that refers to the PRIMARY KEY in another table. The table with the foreign key is called the child table, and the table with the primary key is called the referenced or parent table.

Detailed explanation-3: -Every table can have (but does not have to have) a primary key. The column or columns defined as the primary key ensure uniqueness in the table; no two rows can have the same key. The primary key of one table may also help to identify records in other tables, and be part of the second table’s primary key.

Detailed explanation-4: -In the Orders table it is called a foreign key. A foreign key, simply stated, is another table’s primary key. For more information, see Database design basics. 1. Primary key.

There is 1 question to complete.