DB-Design

박종욱·2021년 10월 28일
0

database system

목록 보기
1/5

Overview of Database Design
1. Requirement Analysis
2. Conceptual design : ER Diagramvs. UML
3. Logical design : RDB Schema
4. Physical design

Conceptual Design

Entities and Relationships
What are the integity constraints
ER diagrams 생성, semi0=-automatic

  1. Entity
    다른 객체와는 명확하게 구분되는 신세계의 객체
    set of attributes

  2. Relationships
    두개 이상의 엔티티의 관계
    Realtionship Set : binary, ternary (터너리는 여러개가 연결됨)

  1. Key Constraints (M:1)

  2. Participation Constraints
    total vs partial

    Every did value in Departments table must appear in a row of the Manages table (with a non-null ssnvalue!)

  3. Class Hierarchy
    Superclass vs Subclass
    Specialization (하위만들기) vs Generalization (상위만들기)
    Overlapping(둘다 하위에 포함 될 수 있을때) and covering constraint

Logical DB design

  1. Entity Sets of Tables

    Note : in RDB, field has atomic value!
    별표가 붙으면 ER 모델링에서는 복수로 허용이 됨.
    하지만 RDB에서는 허용불가능, 하지만 partial하게 긴 스트링을 나눌 수는 있음
    (ex. phone_number)

  2. Relationship Sets to Tables

  3. Translating ER Diagrams with Key Constqraints

  4. Translating Class Hierarchy
    EMP, H_EMP (ssn, name, lot, h_wages, h_worked), C_EMP ( … )
    EMP, H_EMP(ssn, h_wages,h_worked), C_EMP
    EMP (…, emp_type, h_wages, h_worked, contractid)

Schema Refinement and Normal Froms

  1. The Evils of Redundancy (정보의 중복)
    저장소 낭비, 정보 업데이트할 때 모든 튜플에 접근해야함, 내부 정보(관계)들이 삭제될 수 있다.

  2. Decomposition (테이블을 나눈다)
    별도의 테이블로 빼내는 것.

    5등급이 모두 삭제되어도 5등급은 7달라를 가리키는 정보는 유지된다.

    ex) SNLRWH -> SNLRH and RW.
    여러 관계의 집합을 2개 이상의 관계를 분리해주는 것.

  3. Problems with Decompositions
    1) Performance : 여러개의 테이블을 조인해야할 수 있다.
    2) Information loss : 잘못 디컴포스하면 원래 테이블을 참조할 수 없다.
    3) Dependency loss : 디펜던시를 체크할 경우에 디컨퍼시 관계의 instance를 조인해야함
    Normal forms: 1st, 2nd, BC(Boyce-Codd), 3rd, 4th, 5th (점점 정규화)
    The concept of functional dependencies가 사용됨.

  4. Functional Dependencies (FDs)
    t1 r, t2 r, (t1) = (t2) implies (t1) = (t2)
    i.e., if t1.x = t2.x, then t1.Y = t2.Y
    We say that X functionally determines Y

ABCD
a1b1c1d1
a1b1c1d2
a1b2c2d1
a2b1c3d1

AB -> C
일종의 Integrity Constraint (IC)로 볼 수 있다. (전부 만족시켜야 함)

Multidimensional Data Model

Fact table: a set of tuples with numeric measures with a set of dimensions

  1. Dimension Hierarchy

  2. Star Schema

    all these relations is called a star join

profile
반갑습니다.!!! :)

0개의 댓글