Functional Dependency(DB)

최찬호·2023년 4월 1일
0

FD

  • 한 테이블에 있는 두 개의 attribute(s) 집합(set)사이의 제약
  • X의 값에 따라 Y값이 유일하게 결정되는 것
  • X가 Y를 함수적으로 결정한다 (functionally determine)
  • Y가 X에 함수적으로 의존한다 (functionally dependency)
  • 두 집합 사이의 이러한 제약관계를 FD(Functional Dependency)라고 한다
  • 테이블의 state(특정 순간의 특정 상태)를 보고 FD를 파악해서는 안된다
  • 테이블의 스키마를 보고 의미적으로 파악해야 한다
  • 구축하려는 DB의 attributes가 관계적으로 어떤 의미(sementic)을 지닐지에 따라 FD들이 달라진다

ex X -> Y # (left-hand side) -> (right-hand side)

Trivial FD

when X -> Y holds, if Y is subset of X, then X -> Y is trivial FD
ex) X => { A, B, C }
subset of X => {}, { A }, { B }, { C }, { A, B }, {A, C}, {B, C}, { A, B, C }
{ A, B, C } -> {A, C} is trivial FD
{ A, B, C } -> {} is trivial FD
Y(right-hand side)가 X(right-hand side)의 subset일 때 trivial FD

Non-trivial FD

when X -> Y holds, if Y is not subset of X, then X -> Y is Non-trivial FD

{ A, B, C } -> { B, C, D } is Non-trivial FD
{ A, B, C } -> { D, E } is Non-trivial FD & completely Non-trivial FD

Partial FD

when X -> Y holds, if any proper subset of X can determine Y, then X -> Y is partial FD

**proper subset**이란 X의 부분 집합이지만 X와 동일하지는 않은 집합
ex) X => { A, B, C }
subset => {}, { A }, { B }, { C }, { A, B }, {A, C}, {B, C}, { A, B, C } 
proper subset => {}, { A }, { B }, { C }, { A, B }, {A, C}, {B, C}

when { empl_id, empl_name } -> { birth_date } holds, because { empl_id } can determine { birth_date } then this FD is Partial FD

Full FD

when X -> Y holds, if every proper subset of X can not determine Y, then X -> Y is Full FD

when { stu_id, class_id } -> { grade } holds, because { stu_id }, { class_id }, { } can not determine { grade } then this FD is Full FD

profile
체득하고 이해하자

0개의 댓글