WGU C427 OBJECTIVE ASSESSMENT FINAL
VERIFIED EXAM NEWEST 2026/2027 COMPLETE 300
QUESTIONS AND CORRECT ANSWERS WITH
RATIONALES (VERIFIED ANSWERS) |ALREADY
GRADED A+||NEWEST EXAM!!!
What do the ON DELETE and ON UPDATE clauses
specify in a FOREIGN KEY constraint? - ANSWER-The
ON DELETE and ON UPDATE clauses specify the actions
to be taken when the referenced primary key is deleted or
updated. Options include RESTRICT, SET NULL, SET
DEFAULT, and CASCADE.
Refer to the following CREATE TABLE statement. What
actions are specified for ON DELETE and ON UPDATE?
```sql CREATE TABLE Department ( Code TINYINT
UNSIGNED, Name VARCHAR(20), ManagerID
SMALLINT UNSIGNED, PRIMARY KEY (Code),
FOREIGN KEY (ManagerID) REFERENCES
Employee(ID) ON DELETE SET NULL ON UPDATE
CASCADE ); ``` - ANSWER-- ON DELETE SET NULL:
When the referenced primary key is deleted, the foreign
key is set to NULL. - ON UPDATE CASCADE: When the
referenced primary key is updated, the foreign key is
updated to the new value.
,2|Page
True or False: A fully NULL foreign key violates referential
integrity. - ANSWER-False
What happens if Maria Rodriguez's ID is changed to 9925
in the Employee table? ```plaintext Employee ID Name
Salary 2538 Lisa Ellison 45000 5384 Sam Snead 30500
6381 Maria Rodriguez 92300 Department Code Name
Manager 44 Engineering 2538 82 Sales 6381 12
Marketing 6381 99 Technical Support NULL ``` -
ANSWER-This violates referential integrity as Maria
Rodriguez manages Sales and Marketing, and changing
her ID to 9925 leaves these departments without a valid
manager
What is a constraint in a relational database? - ANSWER-
A constraint is a rule that governs allowable values in a
database. Constraints are implemented with special
keywords in a CREATE TABLE statement. The database
automatically rejects insert, update, and delete statements
that violate a constraint.
Name the different types of constraints that can be applied
to columns and tables. - ANSWER-1. NOT NULL 2.
DEFAULT 3. PRIMARY KEY 4. FOREIGN KEY 5.
UNIQUE 6. CHECK
,3|Page
What is the difference between a column constraint and a
table constraint? - ANSWER-- A column constraint
appears after the column name and data type in a
CREATE TABLE statement and governs values in a single
column. Ex: NOT NULL. - A table constraint appears in a
separate clause of a CREATE TABLE statement and
governs values in one or more columns. Ex: FOREIGN
KEY.
Refer to the Employee table. Identify the column and table
constraints. ```sql CREATE TABLE Employee ( ID INT,
Name VARCHAR(20) NOT NULL, DepartmentCode INT
DEFAULT 999, PRIMARY KEY (ID), FOREIGN KEY
(DepartmentCode) REFERENCES Department(Code) );
``` - ANSWER-- Column constraints: `NOT NULL`,
`DEFAULT 999` - Table constraints: `PRIMARY KEY (ID)`,
`FOREIGN KEY (DepartmentCode)`
What is the UNIQUE constraint, and how is it applied to
single and multiple columns? - ANSWER-The UNIQUE
constraint ensures that values in a column, or group of
columns, are unique. When applied to a single column,
UNIQUE may appear either in the column declaration or a
separate clause. When applied to a group of columns,
UNIQUE is a table constraint and must appear in a
separate clause.
, 4|Page
Refer to the Employee table. Identify the UNIQUE
constraints. ```sql CREATE TABLE Employee ( ID
SMALLINT UNSIGNED, Name VARCHAR(60), Extension
CHAR(4), Username VARCHAR(50) UNIQUE, UNIQUE
(Name, Extension), PRIMARY KEY (ID) ); ``` - ANSWER--
Column UNIQUE constraint: `Username VARCHAR(50)
UNIQUE` - Table UNIQUE constraint: `UNIQUE (Name,
Extension)`
What is the CHECK constraint, and how is it used? -
ANSWER-The CHECK constraint specifies an expression
on one or more columns of a table. The constraint is
violated when the expression is FALSE and satisfied when
the expression is either TRUE or NULL. CHECK may
appear either in the column declaration or a separate
clause.
Refer to the Employee table. Identify the CHECK
constraints. ```sql CREATE TABLE Employee ( ID
SMALLINT UNSIGNED, Name VARCHAR(60), BirthDate
DATE, HireDate DATE CHECK (HireDate >= '2000-01-01'
AND HireDate <= '2019-12-31'), CHECK (BirthDate <
HireDate), PRIMARY KEY (ID) ); ``` - ANSWER-- Column
CHECK constraint: `HireDate DATE CHECK (HireDate >=
'2000-01-01' AND HireDate <= '2019-12-31')` - Table
CHECK constraint: `CHECK (BirthDate < HireDate)`