check constarints not working
CREATE TABLE CUSTOMERS(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL CHECK (AGE >= 18),
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
);
I have created table. But it allowed me to add age <18. How to solve it .
I need to check age>=18. how to write query for that?
No comments:
Post a Comment