WGU C427 OBJECTIVE ASSESSMENT FINAL EXAM LATEST 2025/2026 ACTUAL
EXAM WITH COMPLETE QUESTIONS AND CORRECT DETAILED ANSWERS
(100% VERIFIED ANSWERS) |ALREADY GRADED A+| ||PROFESSOR VERIFIED||
||BRANDNEW!!!||
What are the rules that foreign keys must follow? - ANSWER-1.
Foreign key values may be repeated. 2. Foreign key values may
be NULL. 3. Foreign key values must either be NULL or match
some value of the referenced primary key.
Refer to the Department and Employee tables. Identify the foreign
key and the referenced primary key. ```plaintext Department Code
Name Manager 44 Engineering 2538 82 Sales 6381 12 Marketing
6381 99 Technical Support NULL Employee ID Name Salary 2538
Lisa Ellison 45000 5384 Sam Snead 30500 6381 Maria
Rodriguez 92300 ``` - ANSWER-- Foreign key: `Manager` in the
Department table - Referenced primary key: `ID` in the Employee
table
What is referential integrity in the context of foreign keys? -
ANSWER-Referential integrity is a relational rule that requires
foreign key values to be either fully NULL or match some primary
key value.
,2|Page
How do you add a foreign key constraint in a CREATE TABLE
statement? - ANSWER-```sql CREATE TABLE Department ( Code
TINYINT UNSIGNED, Name VARCHAR(20), ManagerID
SMALLINT UNSIGNED, PRIMARY KEY (Code), FOREIGN KEY
(ManagerID) REFERENCES Employee(ID) ); ```
Refer to the following CREATE TABLE statements. What foreign
key constraint is being added? ```sql CREATE TABLE Album ( ID
INT, Title VARCHAR(60), ReleaseYear INT, PRIMARY KEY (ID) );
CREATE TABLE Song ( ID INT, Title VARCHAR(60), Artist
VARCHAR(60), AlbumID INT, PRIMARY KEY (ID), FOREIGN
KEY (AlbumID) REFERENCES Album(ID) ); ``` - ANSWER-The
`AlbumID` column in the `Song` table is a foreign key that
references the `ID` column in the `Album` table.
Can a table have multiple foreign keys? Provide an example. -
ANSWER-Yes, a table can have multiple foreign keys. ```plaintext
DepartmentStaff Code Name Manager Assistant 44 Engineering
2538 5384 82 Sales 6381 NULL 12 Marketing 6381 5384 99
Technical Support NULL 5384 ``` In this example, both `Manager`
and `Assistant` are foreign keys that refer to the `ID` primary key
in the `Employee` table.
,3|Page
What is a composite foreign key, and what are its requirements? -
ANSWER-A composite foreign key consists of multiple columns
that must match the corresponding primary key columns. All
columns of a composite foreign key must either be NULL or
match the corresponding primary key columns.
Refer to the Family and HealthPlan tables. Identify the composite
foreign key and the referenced composite primary key. ```plaintext
HealthPlan PlanNumber PlanName (EmployeeID
DependentNumber) 323 Blue Shield 6381 1 552 Anthem 6381 2
926 Anthem 6381 3 801 UnitedHealthcare 6381 4 666
UnitedHealthcare NULL NULL Family ID Number Relationship
Name 2538 1 Spouse Henry Ellison 2538 2 Son Edward Ellison
6381 1 Spouse Jose Rodriguez 6381 2 Daughter Gina Rodriguez
6381 3 Daughter Clara Rodriguez ``` - ANSWER-- Composite
foreign key: `(EmployeeID, DependentNumber)` in the HealthPlan
table - Referenced composite primary key: `(ID, Number)` in the
Family table
True or False: The data type of foreign key and primary key
columns must be the same. - ANSWER-True
, 4|Page
True or False: Values in a foreign key must be unique. -
ANSWER-False
Which table has a composite foreign key? ```plaintext 1.
DepartmentStaff table 2. EmployeeManager table 3. HealthPlan
table ``` - ANSWER-HealthPlan table
What is referential integrity in relational databases? - ANSWER-
Referential integrity is a rule that requires foreign key values to be
either fully NULL or match some primary key value.
What are the four ways to violate referential integrity? - ANSWER-
1. A primary key is updated. 2. A foreign key is updated. 3. A row
containing a primary key is deleted. 4. A row containing a foreign
key is inserted.
Refer to the Department and Employee tables. Identify the foreign
key value that violates referential integrity. ```plaintext Department
Code Name Manager 44 Engineering 2538 82 Sales 6381 12
Marketing 6381 99 Technical Support 3829 Employee ID Name