Relation

신예환·2023년 3월 22일
0
post-thumbnail

Functional Dependency

  • the value of one (set of) attribute(s) determines the value of a second(set of) attribute(s)
  • 하나의 속성 값이 다른 두번 째 속성 값을 결정하는 것이 함수종속
  • 결정자(determinant)
  • 복합키(Composite determinants)
    • A -> (B,C) = A -> B and A-> C
    • (B,C) -> A

Key

  • combination of one or more columns that is used to identify rows in a relation
  • 키의 성질
    • 유일성(uniqueness), 최소성(minimality)
  • Primary key
    • There is only one primary key per relation -> 디스크에 저장되는 순서(구조), index를 준다, 혜택, B+tree
    • 복합키일 수도 있음
    • ideal primary key : short, numeric and never changes

Modification Anomalies

  • Deletion anomaly : 하나의 정보를 삭제하면 다른 필요한 정보까지 삭제된다.
  • Insertion anomaly : 불필요한 정보를 입력해야한다.
  • Update anomaly : 하나 고치면 다 고쳐야 한다.

Normal Forms

정규화의 핵심을 파악!

  • 1NF : atomic value
  • 2NF : 복합키 전체에 종속 -> 부분함수 종속 제거
  • 3NF : 기본키 외에 결정자가 없을 때 -> 이행함수 종속 제거
  • BC/NF : 모든 결정자가 후보키 -> 키가 아닌 결정자 제거
  • 4NF
  • 5NF
profile
더디가도 함께가자

0개의 댓글