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.
- AForeign key in Employee table; primary key in Payroll table
- BCandidate key in Employee table; super key in Payroll table
- CPrimary key in Employee table; foreign key in Payroll tableCorrect
- 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
- A startup ships a mobile app whose source code is released under a licence permitting anyone to view, modify and redistribute it. Another ve…
- Kaveri Pharma uses a cloud provider whose data centres are located outside India to store employee personal data. The company's board asks t…
- A company runs unlicensed copies of an operating system on 40 office computers and also alters the operating system's licence-verification c…
- A company secretary advises a logistics firm whose delivery tablets, smart meters and sensors each contain a small dedicated computer perfor…
- Under the Information Technology Act, 2000, a person dishonestly copies data from a computer system of a firm without the owner's permission…
- A start-up's developer writes a program in Python, which is run by an interpreter. Compared with a compiled language such as C, which statem…