Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The numbers (1) through (4) are not part of the declaration, but will be used to

ID: 3545185 • Letter: T

Question


The numbers (1) through (4) are not part of the declaration, but will be used to refer to certain lines. Our intent is that both id and ssNo are keys by themselves, and that the value of managerID must be one of the values that appears in the id attribute of the same relation Emps. Which of the following isnot a legal addition of SQL standard key and/or foreign-key constraints? Note: the addition does not have to achieve all the goals stated; it must only result in legal SQL.

The numbers (1) through (4) are not part of the declaration, but will be used to refer to certain lines. Our intent is that both id and ssNo are keys by themselves, and that the value of managerID must be one of the values that appears in the id attribute of the same relation Emps. Which of the following isnot a legal addition of SQL standard key and/or foreign-key constraints? Note: the addition does not have to achieve all the goals stated; it must only result in legal SQL.

Suppose we start with the following relation-schema declaration:

Explanation / Answer

Add PRIMARY KEY just before the comma on line (1), and add UNIQUEjust before the comma on line (2).