PK - Primary Key
NN - Not Null
BIN - Binary (stores data as binary strings. There is no character set so sorting and comparison is based on the numeric values of the bytes in the values.)
UN - Unsigned (non-negative numbers only. so if the range is -500 to 500, instead its 0 - 1000, the range is the same but it starts at 0)
UQ - Create/remove Unique Key
ZF - Zero-Filled (if the length is 5 like INT(5) then every field is filled with 0’s to the 5th digit. 12 = 00012, 400 = 00400, etc. )
AI - Auto Increment
G - Generated column. i.e. value generated by a formula based on the other columns
[정리]
제약조건 | 세부설명 |
PK (Primary Key) | 기본키, 중복이나 빈 값이 들어올 수 없음 |
NN (Not Null) | 빈 값이 들어올 수 없음 |
BIN (Binary) | 데이터를 이진 문자열로 저장 |
UN (Unsigned) | 마이너스 범위 삭제 |
UQ (Unique Key) | 중복 값을 넣을 수 없음 |
ZF (Zero Filled) | 컬럼 크기보다 작은 값을 넣었을 경우 0으로 채운 뒤 삽입 |
AI (Auto Increment) | Insert 시마다 값 1씩 늘어남 |
G (Generated Column) | 다른 열을 기반으로 한 수식으로 생성된 값 |
'SQL' 카테고리의 다른 글
[SQL] 예약어 대문자로 설정하기 (UPPERCASE) (0) | 2022.02.11 |
---|---|
[SQL] 데이터베이스를 다이어그램으로 변경하기 (0) | 2022.02.07 |
[SQL] 다이어그램에서 테이블 생성하기 (0) | 2022.02.03 |
[SQL] IntelliSense 기능 (0) | 2022.01.30 |
[SQL] 데이터 마트 생성 및 데이터 정합성 (0) | 2022.01.25 |