SQL PRIMARY KEY Constraint
SQL PRIMARY KEY Constraint
레코드를 식별하는 역할을 하는 column을 정하는 명령어
SQL PRIMARY KEY on CREATE TABLE
CREATE TABLE Persons (
ID int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Age int
);
SQL PRIMARY KEY on ALTER TABLE
ALTER TABLE Persons
ADD PRIMARY KEY (ID);
DROP a PRIMARY KEY Constraint
ALTER TABLE Persons
DROP PRIMARY KEY;
'Computer Science > Database' 카테고리의 다른 글
W3Schools SQL | #48 SQL CHECK CONSTRAINT (0) | 2022.10.30 |
---|---|
W3Schools SQL | #47 SQL FOREIGN KEY CONSTRAINT 이용법 (0) | 2022.10.30 |
W3Schools SQL | #44 SQL NOT NULL CONSTRAINT 제약 조건 (0) | 2022.10.29 |
W3Schools SQL | #43 SQL CONSTRAINT 제약 조건 (0) | 2022.10.29 |
W3Schools SQL | #42 SQL ALTER TABLE 구문 (0) | 2022.10.29 |