Number Data
Type: This data type allows us to enter numeric values
i.e. either integer (or) decimal values
Integer:
This data type allows us to enter only integer values i.e. either positive(+ve)
numbers (or) Negative (-ve) numbers
This data type further divided into
4 types
1.
Tiny int → 1 byte
2.
Small int → 2 bytes
3.
int → 4 bytes
4.
Long int → 8 bytes
These data types
occupies the memory in 1, 2, 4, 8 bytes respectively
These data types allows
the column values like Student Roll no, Employee Id etc,
Ex:
EmpId int
EmpId represent column
name
Int
represent data type (4 bytes)
Decimal Data
type:
This
data type allows us to enter only Decimal values such as employee salary,
student average marks etc., These data type is again divided into two types
NUMERIC
(p, s)
DECILMAL
(p, s)
Here
‘p’ represent precision & ‘s’ represent Scale
EX:
ESal NUMERIC (9, 1)
Here
ESAL column name
Numeric
data type
9-p
1-s
Note:
Numeric & Decimal data type are exactly same
Alphabet data
type:
This data type allows us to enter
character values such as student names, employee names etc.,
This data type of
further divided into two types
1. Char
[size]
2. Varchar
[size]
Char [size]:
This data type allows us to enter
only alphabets and it allows maximum of 1-4000 bytes
It always allocates the
memory in a static fashion
EX:
Sno char [9]
Sno
represents student number, char represents data type, 9 represents size
Varchar [size]:
This data type allows us to enter
alphabets, alpha numeric & numeric values also
This data type allows
maximum of 1-8000 bytes
It always allocates the memory in
Dynamic manner
Date data
type:
This data type allows to enter date
values such as employee joining date, Account opening date etc.,
The default date format
in SQL Server is yyyy-mm-dd
Ex:
1987-12-10
Time stamp:
This data type allows us to enter
both date & time
The default format of
time stamp data type is yyyy-mm-Degree
Ex:
yyyy-mm-dd-hh:mm:ss
1987-12-10
12:49:09
Mislenious data type:
Image Data type:
This data type allows us to enter any picture (or) photos, clipping, sounds etc
No comments:
Post a Comment