Skip to content

CS Professional · Artificial Intelligence, Data Analytics and Cyber Security - Laws and Practice · Computer Hardware and Software

In a company's employee table, the column Employee_ID uniquely identifies every row and can never be null. In another table, Payroll, the column Employee_ID refers to values in the employee table. What are these two columns respectively called?

Employee_ID is the primary key in the Employee table because it uniquely identifies each row and cannot be null. In the Payroll table it is a foreign key, since it refers to the primary key of another table and enforces referential integrity.

  1. AForeign key in Employee table; primary key in Payroll table
  2. BCandidate key in Employee table; super key in Payroll table
  3. CPrimary key in Employee table; foreign key in Payroll tableCorrect
  4. DComposite key in Employee table; alternate key in Payroll table

Explanation

A column that uniquely identifies each row and is non-null is the primary key. A column in another table that refers to that primary key is a foreign key, which enforces referential integrity. Option one reverses the roles.

Did you get it right without looking?

One question tells you little. A timed set on Computer Hardware and Software shows your real accuracy, how long you take and where you lose marks.

More Computer Hardware and Software questions