정규화
Hermaeus Mora ·

-
1NF
columns cannot contain relations or composite values 오직 단일값을 가져야 한다.
-
2NF
It is in 1NF and has a single attribute unique identifier (UID)(in which case every non key attribute is dependent on the entire UID), or It is in 1NF and has a multi-attribute unique identifier, and every regular attribute (not part of the UID) is dependent on all attributes in the multi-attribute UID, not just one attribute (or part) of the UID. 후보 키의 진부분집합이 일반 키를 결정하지 않아야 한다.
학생번호 과목 지도교수 1 수학 김수학 2 과학 이과학 3 과학 이과학 {학생번호, 과목}이 후보 키라고 하자. 과목이 지도교수를 결정하므로 제 2정규화를 만족하지 않는다.
-
3NF
non-prime attributes depend only on the candidate keys and do not have a transitive dependency on another key 일반 키는 후보 키에만 종속되어야 하며 이행 종속적이지 않아야 한다.
회원 번호 등급 할인율 1 vip 50% 2 platinum 30% 회원번호가 후보 키라고 하자. 회원 번호 -> 등급이고 등급 -> 할인율이다. 따라서 회원 번호 -> 할인율이 성립한다. 이같은 관계를 이행 종속적이라고 하며 따라서 제 3정규화를 만족하지 않는다.
-
BCNF
is a superkey 일반 키가 값을 결정하지 않아야 한다.
코트 예약시간 예약 종료 시간 코트 종류 1 09:30 10:30 일반-A 1 11:00 12:00 일반-A 1 14:00 15:30 일반-B 2 10:00 11:30 프리미엄-B 2 11:30 13:30 프리미엄-B 2 15:00 16:30 프리미엄-A 위의 테이블의 후보 키 집합은 {코트, 예약 시간), {코트, 예약 종료시간}, {코트 종류, 예약 시간}, {코트 종류, 예약 종료 시간} 이다.
여기서 코트 종류 -> 코트가 성립한다. 코트 종류는 슈퍼 키가 아니므로, BCNF를 만족하지 않는다.
-
4NF
every one of its non-trivial multivalued dependencies is a superkey 다치 속성의 결정자는 슈퍼 키여야 한다.
Student Course Hobby Alice Math Tennis Alice Science Tennis Alice Math Reading Alice Science Reading 위의 테이블에서 Student Course, Student Hobby로 다치 속성이 존재한다. 그러나 Student는 슈퍼 키가 아니므로() 위 테이블은 제 3정규형을 만족하지 않는다.
-
5NF
every non-trivial join dependency in that table is implied by the candidate keys 조인 종속성을 가진 테이블은 후보 키를 통해 암시되어야 한다
Traveling salesman Brand Product type Jack Schneider Acme Vacuum cleaner Jack Schneider Acme Breadbox Mary Jones Robusto Pruning shears Mary Jones Robusto Vacuum cleaner Mary Jones Robusto Breadbox Mary Jones Robusto Umbrella stand Louis Ferguson Robusto Vacuum cleaner Louis Ferguson Robusto Telescope Louis Ferguson Acme Vacuum cleaner Louis Ferguson Acme Lava lamp Louis Ferguson Nimbus Tie rack 위의 테이블은 다음과 같이 세 개의 테이블로 나눌 수 있다.
Traveling salesman Product type Jack Schneider Vacuum cleaner Jack Schneider Breadbox Mary Jones Pruning shears Mary Jones Vacuum cleaner Mary Jones Breadbox Mary Jones Umbrella stand Louis Ferguson Telescope Louis Ferguson Vacuum cleaner Louis Ferguson Lava lamp Louis Ferguson Tie rack Traveling salesman Brand Jack Schneider Acme Mary Jones Robusto Louis Ferguson Robusto Louis Ferguson Acme Louis Ferguson Nimbus Brand Product type Acme Vacuum cleaner Acme Breadbox Acme Lava lamp Robusto Pruning shears Robusto Vacuum cleaner Robusto Breadbox Robusto Umbrella stand Robusto Telescope Nimbus Tie rack 여기서 Traveling salesman-Brand 테이블과 Brand-Product type를 조인하면 Traveling salesman은 자신의 Brand가 가진 Product type을 Brand 후보 키를 통해 암시할 수 있다.