2.1 Structure of relational Database
table == Relation
Attribute : Column of talbe
Tuple : row in table
*Attribute types
-Domain : the set of allowed vlaues for each attribute
-Attribute values are required to be atomic, that is indivisible
-Null 값이 들어갈수도 있다
*NULL 값이란?
-값이 무엇인지 정의할 수 없는 경우 사용될 수 있다. : 알려지지 않은 값
-값이 무엇인지 알 수 없는 경우
-적용 불가능한 값
-보류된 값
2.2 Database Schema
데이터베이스는 여러 Relation으로 이루어져있다
- Database Schema : Logical design of the database
- Database instance : A snapshot of the data in the database at a given instant in time
- Relation schema : Logical design of a table (Attribute와 연관된 Domains)
- Relation instance : A snapshot of the data in a table at a given instant in time
- Selection
- Project
- Union
- Difference
- intersection
- Join
- Cartesian product
- Natural Join
ex) SELECT Product Name Where Unit Price > 4000
2.Projection
Extract data Vertically(as a column)
Choses some of the attributes of the relation
ex) PROJECT Product Name
3.Union
합집합이다 중복된 것은 제거한다
4.Difference
차집합니다.
5.Intersection
교집합이다.
6.Cartesian Product
행렬 곱하기 이다 3줄 x 3줄 = 9줄 이렇게
7.Natural Join
Relation R과 S에 공통적으로 존재하는 속성들을 이용하여 공통 속성들의 값들이 서로 같은 Tuple들을 조인하는 것이다. 쉽게 말해 같은 부분을 기준으로 두 Relation을 하나로 합침
전체 요약
'일상 > DataBase' 카테고리의 다른 글
SQL 소개 (2) (0) | 2017.09.28 |
---|---|
3.SQL 소개(1) (0) | 2017.09.28 |
SQL 공부 1 (0) | 2017.09.27 |
1.데이터베이스(DataBase)란 (0) | 2017.09.27 |