• Domain (type): Attribute가 가질 수 있는 값의 집합

  • Attribute (column)

  • Tuple (row, record): set of values for attributes

  • Relation (table): set of tuples

Database: set of relations 




Schema & Instance

Schema
the logical structure of the database
type information of a variable in a program
Physical schema: database design at the physical level Logical schema: database design at the logical level

Instance
actual contents at a particular point in time the value of a variable 


NULL

special value for “unknown” or “undefined” 숫자0,빈문자열“”등과는다름
모든 Domain은 NULL값을 포함 함 


Key

Key: Tuple을 구별하기 위한 Attribute 집합 Relation은 동일한 tuple이 있을 수 없음

Superkey (수퍼키)
Relation에서 Tuple을 식별할 수 있는 Unique한 Attribute의 집합

  • Candidate Key (후보키)

    • –  Superkey 중에서 Minimal 한 Key

    • –  Minimal: 하나의 Attribute라도 빼면 더 이상 Key가 아님

  • Primary Key (기본키, PK)

    • –  Candidate Key 중 하나 (Relation을 정의할 때 선택)

    • –  Entity Integrity : NULL이 될 수 없음

  • Foreign Key (참조키, FK)

    • –  타 relation을 참조하는 attribute

    • –  참조하는 relation에서 key는 아니지만, 참조되는 relation에서 primary key임.

    • –  Referential Integrity: 반드시 참조된 relation의 PK 값에 존재하거나 NULL이어야 함 

'컴퓨터공학 > DataBase' 카테고리의 다른 글

NOSQL  (0) 2013.01.21
Database 이론  (0) 2013.01.14

+ Recent posts