테이블 : 행과 열로 이루어진 저장소의 최소 단위
무결성(Integrity) : 비지니스 룰에 적합한가 여부로 판단
-> Integrity Constraint : pk, uk, nn, ck, fk -> Procedure Extension : trigger, ... -> Application
무결성 제약 조건
-> primary key -> unique key -> not null -> check -> foreign key
인덱스, 시퀀스, 뷰
Normailize the Data Model : normalize / 표준화하다 / 표준적으로 하다
-> 정규화 또는 정상화(normalization)는 어떤 대상을 일정한 규칙이나 기준에 따르는 '정규적인' 상태로 바꾸거나, 비정상적인 대상을 정상적으로 되돌리는 과정을 뜻한다.
-> 데이터를 일정한 규칙에 따라 변형하여 이용하기 쉽게 만드는 일. -> History of Normalization
**Normalization is a technique** established by the originator of the relational model, E.F. Codd. The complete set of normalization techniques, include "twelve rules" that databases need to follow in order to be described as truly normalized.
**It is a technique** that was created in support of relational theory, years before entity relationship modeling was developed. The entity relationship modeling process has incorporated many of the normalization techniques to produce a normalized entity relationship diagram.
Two terms that have their origins in the normalization technique are still widely in use. One is normalized data, the other is denormalization.
정규화 방법 : Validate each column's placement using the rules of normalization
[정규화되지 않은 상태]
<사례1> 모든 Domain이 원자값만으로 되어있는 조건을 위반한 사례 = 제1정규형 위반
반복되는 그룹(repeating group)이 발생되는 경우 역시 제1정규형 위반
기본 키 고유 식별자가 사라짐
↓ 제1정규화(1 Normalization) : 반복되는 그룹(repeating group) 제거
[제1정규형(1 Normal Form) : 1NF]
테이블(Relation)이 제 1정규형을 만족했다는 것은 아래 세 가지 조건를 만족했다는 것을 의미한다.
Customer Name과 Customer Telephone Number가 One-to-Many의 관계를 형성
<사례2> Manufacturer Country는 Manufacturer와만 종속관계 (함수 종속)
↓ 제2정규화(2 Normalization) : 복합UID에 대한 부분 종속 제거
[제2정규형(2 Normal Form) : 2NF]
제 2정규화를 수행 했을 경우 테이블의 모든 컬럼이 완전 함수적 종속을 만족한다. (부분 함수적 종속을 모두 제거되었다.)
부분 함수 종속을 제거한 이후의 테이블 = 제2정규형 만족
<사례3> Winner Date of Birth은 기본키가 아닌 속성인 Winner를 거쳐 {Tournament, Year}에 의존 = 제3정규형 위반
↓ 제3정규화(3 Normalization) : Non-UID에 대한 종속 제거
[제3정규형(3 Normal Form) : 3NF]
테이블(Relation)이 제 3정규형을 만족한다는 것은 아래 두 가지 조건을 만족하는 것을 의미한다.
테이블을 둘로 나누어 제3정규형 만족
예제
https://wkdtjsgur100.github.io/database-normalization/
<사례4> 비정규형 테이블 → 제1정규형 테이블
제2정규형 테이블 → 제3정규형 테이블
제3정규화까지 마친 최종 테이블
12 days of denormalization : https://www.orafaq.com/wiki/Fun_stuff
→ Denormalization.pdf