From e1f0635aa1da51d66d377e6ffc6eee0434574828 Mon Sep 17 00:00:00 2001 From: SunKyu Choi <98688494+luke0408@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:28:54 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20[Docs]=20Integrity=20Constraints?= =?UTF-8?q?=20(#4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Item 04 - Integrity Constraints/Note.md | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/Chapter 04 - Intermediate SQL/Item 04 - Integrity Constraints/Note.md b/Chapter 04 - Intermediate SQL/Item 04 - Integrity Constraints/Note.md index 0809c43..89c0e82 100644 --- a/Chapter 04 - Intermediate SQL/Item 04 - Integrity Constraints/Note.md +++ b/Chapter 04 - Intermediate SQL/Item 04 - Integrity Constraints/Note.md @@ -1,5 +1,46 @@ -# Example 1 +# Integrity Constraints -> 작성자: 루카(최선규) +> 작성자: 최선규 -## 목차 +## Not Null + +`NOT NULL` 제약 조건은 특정 컬럼에 `NULL` 값을 허용하지 않는다는 것을 의미한다. + +ex) + + ```sql + CREATE TABLE table_name ( + column_name1 datatype NOT NULL, + column_name2 datatype, + ... + ); + ``` + +## Unique + +'UNIQUE' 제약 조건은 특정 컬럼에 중복된 값을 허용하지 않는다는 것을 의미한다. + +ex) + + ```sql + CREATE TABLE table_name ( + column_name1 datatype UNIQUE, + column_name2 datatype, + ... + ); + ``` + +## Check clause + +`CHECK` 제약 조건은 특정 컬럼에 특정 조건을 만족하는 값만 허용한다는 것을 의미한다. + +ex) + + ```sql + CREATE TABLE table_name ( + column_name1 datatype, + column_name2 datatype, + ... + CHECK (column_name1 > 0) + ); + ```