***왠만하면 VARCHAR 쓰는 것이 편함
CHAR 만이 가지고 있는 특징
CHAR has a fixed length.
ex. CHAR(3) --> only 3 characters allowed
CHAR is faster for fixed length text
ex. State abbreviations/ Yes or No flags / Sex
: WHOLE NUMBERS
DECIMAL(5,2) = DECIMAL(Total num of Digits, Digits after Decimal)
***DECIMAL 조건에 맞지 않는 데이터 삽입할 경우:
DECIMAL(5,2) --> INSERT (8993746)
: return (999.99)
: 나타낼 수 있는 가장 큰 수로 출력
DECIMAL(5,2) --> INSERT (298.9999)
: return (299.00) 소수점 아래 3번째 자리에서 반올림
DECIMAL(5,2) --> INSERT (1.9999)
: return (2.00) 소수점 아래 3번째 자리에서 반올림
둘 다 소수를 나타내며, byte 차이만 있음
(소수점 아래 출력 가능 자릿수)
- FOAT :
4bytes of memories needed
Precision issues ~7 digits- DOUBLE:
8bytes of memories needed
Precision issues ~15 digits