SQL CHECK Constraint
SQL CHECK Constraint
값의 범위를 제한하는 Constraint
SQL CHECK on CREATE TABLE
CREATE TABLE Persons (
ID int NOT NULL.
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
CHECK (Age >= 18)
);
SQL CHECK on ALTER TABLE
ALTER TABLE Persons
ADD CHECK (Age >= 18);
DROP a CHECK Constraint
ALTER TABLE Persons
DROP CONSTRAINT CHK_PersonAge;
'Computer Science > Database' 카테고리의 다른 글
W3Schools SQL | #50 SQL CREATE INDEX 구문 (0) | 2022.10.30 |
---|---|
W3Schools SQL | #49 SQL DEFAULT CONSTRAINT 이용법 (0) | 2022.10.30 |
W3Schools SQL | #47 SQL FOREIGN KEY CONSTRAINT 이용법 (0) | 2022.10.30 |
W3Schools SQL | #46 SQL PRIMARY KEY CONSTRAINT 이용법 (0) | 2022.10.30 |
W3Schools SQL | #44 SQL NOT NULL CONSTRAINT 제약 조건 (0) | 2022.10.29 |