컴퓨터/DB, SQL

(edX stanfordOnline Databases: Modeling and Theory) Relational Design Overview

수제녹차 2025. 5. 6. 21:04
728x90
반응형

https://www.edx.org/course/modeling-and-theory

 

StanfordOnline: Databases: Modeling and Theory | edX

This course is one of five self-paced courses on the topic of Databases, originating as one of Stanford's three inaugural massive open online courses released in the fall of 2011. The original "Databases" courses are now all available on edx.org. This cour

www.edx.org

 

* Designing good schemas for relational database

SSN = Social Security Number

현실 세계를 잘 표현하는지가 중요하다

1st NF: relations are real relations with atomic values in each cell.

Functional Dependency: SSN이 sName을 결정한다면, (SSN, sName)을 한 번만 저장해야 한다

ex. Took(sID, name, courseNum, title) 릴레이션이 있을 때.

sID는 unique, courseNum도 unique

functional dependencies for relation Took

sID -> name, courseNum -> title

double arrow: A가 B의 여러 값을 독립적으로 결정함(B와 다른 속성 C 등이 서로 독립)

동일 SSN에 대해 cName X HS 조합으로 튜플이 여러 개 생길 수 있다

 

함수적 종속은 아니다

동일 SSN이 여러 cName을 가질 수 있기 때문에 함수적 종속은 아님. HS도 동일

 

SSN -> cName ❌

SSN ↠ cName 

 

decompose로 다치 종속 해결 후, cName + HS 개수만큼의 튜플을 가질 수 있다

반응형