본문 바로가기

데이터베이스

DBMS - (2) The Relational Model

DBMS - (2) The Relational Model

RDBMS의 특성
- Used by all major commerical database system.
- Very simple model
- Query with high-level languages : simple yet expressive
- Efficient implementations

The Relational Model
(1) DBMS = Set of named relations(=tables) ex. Student table, College table, etc...
(2) Each relation has a set of named attuributes(=columns)
(3) Each tuple(=row) has a value for each attribute
(4) Each attribute has a type(=domain)

Terminologies
(1) Schema : Structural description of relations in database.
(2) Instance : actual contents at given point in time(schema가 구현된 해당 테이블 전체(모든 튜플포함))
(3) NULL : special value for 'unknown' or 'undefined'
- RDBMS에서 NULL은 query 혹은 relation간 조인 연산시 크게 고려해야될 문제
(4) Key : attribute whose value is unique in each tuple or set of attributes whose combined values are unique.
- Key는 해당 relation의 search index로 사용됨(RDBMS는 이것을 위해 Key는 별도로 특별 구현) 
- Key는 다른 relation의 tuple을 포인팅 하는 용도로도 사용됨

Creating relations(=tables) in SQL
- create Table Student(ID, name, GPA, photo)
- create Table College(name string, state char(2), enrollent integer)

Reference
https://www.youtube.com/watch?v=nf1-h2GpEGc&list=PL6hGtHedy2Z4EkgY76QOcueU8lAC4o6c3&index=3