PrepAway - Latest Free Exam Questions & Answers

which column in the Employee table should you create a Foreign Key constraint that references a different tabl

You administer a Microsoft SQL Server 2012 database.
The database contains a table named Employee. Part of the Employee table is shown in the exhibit.
(Click the Exhibit button.)

Unless stated above, no columns in the Employee table reference other tables.
Confidential information about the employees is stored in a separate table named EmployeeData.
One record exists within EmployeeData for each record in the Employee table.
You need to assign the appropriate constraints and table properties to ensure data integrity and
visibility.
On which column in the Employee table should you create a Foreign Key constraint that references a
different table in the database?

PrepAway - Latest Free Exam Questions & Answers

A.
DateHired

B.
Departments

C.
EmployeeID

D.
EmployeeNum

E.
FirstName

F.
JobTitle

G.
LastName

H.
MiddleName

I.
ReportsToID

Explanation:
Use the EmployeeID, which would be used as a primary key in the Employee table, when defining a
foreign key constraint from another table in the database.

11 Comments on “which column in the Employee table should you create a Foreign Key constraint that references a different tabl

  1. Manuel says:

    Foreign Key in Employees can’t be EmployeeID, because it’s the primery key. So only DepartmentID or ReportsToID can be defined as Foreign Keys. Because answer B says ‘Departments’ but not ‘DepartmentID’, I think the correct answer will be I, where ReportsToID references Employees table itself. Weird one!!




    0



    0
  2. Kumo says:

    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.

    A FOREIGN KEY constraint does not have to be linked only to a PRIMARY KEY constraint in another table; it can also be defined to reference the columns of a UNIQUE constraint in another table.

    Therefore, I think EmplyeeID is still the correct answer because option B is “Department” not “DepartmentId”




    0



    0
  3. Txiki says:

    kumo, in the original, the option is “departmentId”… its must be an transac error… and I agree with people who thinks option B is the correct answer.




    0



    0

Leave a Reply