Developing SQL Databases — Question 171

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution. Determine whether the solution meets the stated goals.
You have a database that contains a table named Employees. The table stores information about the employees of your company.
You need to implement and enforce the following business rules:
✑ Limit the values that are accepted by the Salary column.
✑ Prevent salaries less than $15,000 and greater than $300,000 from being entered.
✑ Determine valid values by using logical expressions.
✑ Do not validate data integrity when running DELETE statements.
Solution: You implement a check constraint on the table.
Does the solution meet the goal?

Answer options

Correct answer: A

Explanation

The solution is correct because a check constraint effectively restricts the Salary column to only allow values within the specified range of $15,000 to $300,000. This ensures that the business rules are enforced during INSERT and UPDATE operations, while the note about DELETE statements clarifies that integrity checks are not needed in those cases. Therefore, the other option, which claims the solution does not meet the goal, is incorrect.