정규화 - 함수 종속

dragonappear·2023년 7월 12일

Database 101

목록 보기
7/10


함수 종속

함수 종속이란

한 테이블에 있는 attribute(s) 두 개의 부분 집합 X, Y가 있을 때 X 값에 따라 Y 값이 유일하게 결정될 때

  • X가 Y를 함수적으로 결정한다.
  • Y가 X를 함수적으로 의존한다.
    라고 말한다.

두 집합 사이의 이러한 제약관계를 FD(functional dependency) 라고 부르고, X -> Y 로 표기한다.

  • 위 테이블에서
    • X = {isbn,author_num}
    • Y = {book_title,leatname,publisher,royalty,edition}가 있을 때
  • X -> Y 이다.

함수 종속 주의 사항

  • 테이블의 스키마를 보고 의미적으로 파악해야 하지, 테이블의 특정 state를 보고 FD를 파악해서는 안된다.
  • 함수 종속에서 기본키나 후보키만 결정자가 되는 것은 아니다.
    • 기본키나 후보키가 아니더라도 속성 Y 값을 유일하게 결정하는 속성 X는 모두 결정자가 될 수 있다.

Trivial FD

  • When X->Y holds
  • if Y is subset of X
  • then X->Y is trivial FD

{a,b,c} -> {c}

Non-Trivial FD

  • When X->Y holds
  • if Y is not subset of X
  • then X->Y is Non-trivial FD

{a,b,d} -> {b,c,d} is non-trivial FD
{a,b,c} -> {d,e,f} is 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

{empl_id,empl_name} -> {birth_date} is partial FD because {empl_id} -> {birth_date}

Full FD

  • When X->Y holds
  • if every proper subset of X cannot determine Y
  • then X->Y is Full FD

{stu_id,class_id} -> {grade} is full fd becuase {},{stu_id},{class_id} cannot determine {grade}

Transitive FD

  • When X->Y and Y->Z holds,
  • then X->Z is transitive FD
  • unless either Y or Z is not subset of any key

{account_id} -> {empl_name} is transitive fd becuase {account_id} -> {empl_id}, {empl_id} -> {empl_name}

0개의 댓글