SQL DEFAULT Constraint
SQL DEFAULT Constraint
column 값의 디폴트 값을 설정한다.
SQL DEFAULT on CREATE TABLE
CREATE TABLE Persons (
ID int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int,
City varchar(255) DEFAULT 'Sandnes'
);
SQL DEFAULT on ALTER TABLE
ALTER TABLE Persons
ALTER City SET DEFAULT 'Sandnes';
DROP a DEFAULT Constraint
ALTER TABLE Persons
ALTER City DROP DEFAULT;
'Computer Science > Database' 카테고리의 다른 글
W3Schools SQL | #51 SQL AUTO INCREMENT 필드 (0) | 2022.10.30 |
---|---|
W3Schools SQL | #50 SQL CREATE INDEX 구문 (0) | 2022.10.30 |
W3Schools SQL | #48 SQL CHECK 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 |