Computer scienceFundamentalsSQL and DatabasesBasics SQLData Definition Language

CHECK constraint

Another Error

Report a typo

CREATE TABLE employees (
    employee_id INT PRIMARY KEY, 
    full_name VARCHAR(255) NOT NULL,
    dept_id INT,
    salary INT,
    bonus INT,
    CONSTRAINT chk_employee_dept_id CHECK (dept_id > 0 and dept_id < 20)
);
INSERT INTO employees VALUES (1, 'James Chon', 2, 10000, 200);

Which of the following statements will throw an error?

Select one or more options from the list
___

Create a free account to access the full topic