DBMS 2
DA, SQL, DB보안 등 실무자를 위한 위한 DB기술 바이블!
· Collection Data Types · Row Data Types CREATE TABLE monitoring (col1 SERIAL, col2 CHAR(2000)); INSERT INTO monitoring VALUES (0,'data'); ALTER TABLE monitoring ADD col3 INT; INSERT INTO monitoring VALUES (0,'data'); oncheck -pT stores_demo:monitoring DROP INDEX index_name ;Basic Terminology & Concepts
Basic Terminology & Concepts
IBM Informix Data Types
Built-in Data Types
CHARACTER
BOOLEAN
TIME
입력값
99.06.04
02.06.04
02.12.31
DBCENTURY 설정에
P??1999.06.04
1902.06.04
1902.12.31
따라 저장된 값
F??2099.06.04
2102.06.04
2002.12.31
※ 오늘날짜
C??1999.06.04
2002.06.04
2002.12.31
: 2002.06.04
R??2099.06.04
2002.06.04
2002.12.31
LARGE-OBJECTS
Complex Data Types / User Defined Data Types
Complex Data Types
Complex Data Types
User-Defined Data Types
SQL New Functions
CASE WHEN condition1 THEN result
WHEN condition2 THEN result2
ELSE resultn
END
NVL(value1, value2)
같은 의미 : CASE value1
WHEN null THEN value2
ELSE value1
END
DECODE(value1, value2, value3, value4, ... valuen)
같은 의미 : CASE value1
WHEN value2 THEN value3
…
ELSE valuen
END
TO_DATE(string, [,fmt] )
TO_CHAR(date, [,fmt] )
format 문자
의미
%Y
4자리 연도
%m
월
%B
월 (January, February, March, April, ...)
%d
일
%A
요일 (Monday, Tuesday, Wednesday, ...)
%R
24시간:분
%H
24시간
%M
분d>
%Fn
소수점 이하 n자리 초
TRIM( { LEADING | TRAILING | BOTH } trim_expr FROM source_ )
TRIM(source_expr) = TRIM( TRAILING‘ ’ FROM source_expr )
LPAD ( string, length, [,pad] )
RPAD ( string, length, [,pad] )
UPPER
LOWER
INITCAP
REPLACE ( string, old [,new] )
SUBSTR(string,start [,length] )
start : Positive - Counts forward
Negative - Counts backward
0 - equivalent to 1
SUBSTRING( start [FOR length] )
Start : Positive - Counts forward
Negative - Counts backward from one position before the first character
0 - counts from one position before the first character
IBM Informix Dynamic Server Terminology
Logical Concepts / Physical Concepts
Physical Concepts
create table first_table (
tab_id int,
name char(20) ,
address char(50)
) extent size 32 next size 16 ;
create table second_table
tab_id int,
name char(20) ,
address char(50)
) extent size 16 next size 8 ;
Data Page monitoring
테이블 생성
CREATE TABLE dummy (col1 INT);
데이터 입력 (8건)
컬럼 추가
데이터 입력 (1건)
Monitor
Index Page
인덱스 종류
인덱스 생성 기본 구문
ON table_name ( column_name_list ) [ IN dbspace ] ;인덱스 삭제
다음과 같은 이유로 인덱스 키는 작게 만드는 것이 바람직하다
인덱스 사용의 장점
인덱스 소요 비용
인덱스 사용 가이드