In an employee database, a table called 'employees' has a 'salary' field. The company policy states that no employee should have a salary lower than $30,000. Which type of constraint would be used to ensure this policy is enforced?
A CHECK constraint is used to limit the range of values that can be placed in a column. If you try to insert a salary value of less than $30,000, the database will return an error because of the CHECK constraint. PRIMARY KEY constraints are used to uniquely identify each row in a table. UNIQUE constraints prevent duplicate values in a single column or combination of columns. FOREIGN KEY constraints are used to link two tables together.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What exactly is a CHECK constraint?
Open an interactive chat with Bash
How would I implement a CHECK constraint in SQL?
Open an interactive chat with Bash
What are the differences between CHECK and UNIQUE constraints?