0:02
[Music]
0:11
hello friends welcome back to our
0:13
channel so in today's session we'll
0:15
discuss about one more concept in sql
0:17
that is data types supported in sql
0:27
data types
0:28
in sql so in the previous session we
0:32
have started the
0:33
sql so that is a structured query
0:35
language so there we have seen the
0:37
introduction so here uh
0:40
first of all let us see what is the data
0:42
type and now then we'll see what are the
0:45
different data types supported in this
0:47
particular sql so many of you might know
0:50
about these data types because if you
0:53
are aware about any one of the
0:54
programming language definitely you will
0:56
be knowing about these data types so
0:58
don't worry if you don't know about the
1:00
data types so let me revise this concept
1:02
once again what is the data type
1:04
so here
1:06
the type
1:08
of
1:09
value given
1:11
is called as a
1:12
data type
1:15
so what is this type
1:17
what is this right so in our computer
1:19
terminology
1:20
the complete data
1:23
is divided into different types
1:26
different types
1:28
one is
1:29
numeric
1:32
strings
1:36
okay and
1:38
some images
1:40
etc etc different the data can be
1:42
divided in
1:43
different categories different
1:44
categories right in the numeric we can
1:47
get it as
1:48
integers that means a whole numbers so
1:51
we can simply call it as
1:53
whole numbers
1:55
whole numbers
1:58
real numbers
2:02
complex numbers etc etc and similarly
2:06
the strings we can call it as a
2:07
characters
2:09
and strings
2:12
right so similarly the whole numbers
2:15
here the whole numbers are represented
2:17
as
2:18
integers
2:20
integers
2:21
and real numbers are
2:23
floats float values
2:26
the complex is complex and the
2:28
characters are a characters and this is
2:31
as usual we call it as a
2:33
strings right so
2:36
we have seen the basic concepts of rdbms
2:40
in that we have seen the concepts like
2:42
entity
2:44
or we can simply call it as a row or we
2:47
can simply call it a tuple similarly
2:51
columns
2:52
so columns
2:53
are
2:54
attributes
2:56
attributes so what we call these
2:58
attributes so these attributes are the
3:02
characteristics of any entity okay the
3:04
characteristics of any entity we call it
3:06
as attributes so definitely these
3:08
attributes will hold some
3:11
values holds some values and we have to
3:15
define the attributes with this
3:18
particular data types
3:19
okay so every value will be having the
3:22
type which type of data which type of
3:25
data for example if you want to store
3:27
the student table
3:28
student table so we need to give the
3:31
attributes like
3:32
student id
3:35
student name
3:38
student percentage so let us take only
3:40
these three so if you take the student
3:43
id so it is just like one zero one one
3:46
zero two etcetera etcetera
3:48
names some abc or def etcetera etcetera
3:53
and percentage seventy five point three
3:56
eighty five point nine
3:59
so you can see all these are
4:02
whole numbers so
4:03
this should be implemented by using
4:06
integer so we have to represent it as an
4:09
integer that means sid is an attribute
4:12
which holds the numbers what is this
4:16
numbers type it's an integer so integer
4:19
similarly yes name so this is a group of
4:21
characters we call it as a strings we
4:24
call it as a strings and percentage so
4:28
these are float values real numbers
4:30
right so this will be represented as
4:32
float
4:35
right so
4:36
the
4:36
data type is a type of a value which is
4:40
stored in an attribute attribute or
4:42
variable whatever it may be
4:44
so
4:45
now what are the different data types
4:47
that are supported in sql
4:50
let us see
4:54
so hope you got an idea about what is
4:56
the data type what is the data right
4:59
so similar to our programming language
5:01
concepts so here also we are going to
5:04
use the attributes and definitely while
5:06
creating the table itself we have to
5:08
define the attribute and we have to
5:10
declare that attribute with the
5:12
particular data type corresponding data
5:14
right so corresponding data type means
5:16
the type of value which is being stored
5:19
in the attitude
5:20
now
5:22
now what are the different data types
5:25
so
5:27
data types
5:29
in
5:30
sql
5:36
so the first one is
5:49
binary data type
5:51
okay i will let you know when we we are
5:54
going to use this binary
5:56
binary
6:01
yes
6:02
numeric
6:08
strings
6:14
date and
6:16
time
6:17
binary numeric strings and data
6:20
and this binary is used to store the
6:22
images in a database so similar to the
6:25
values we can also store the images
6:27
right so in order to store the images
6:30
the data type is a binary
6:32
okay and coming to the numeric again it
6:34
is divided into two types
6:37
one is
6:42
approximate
6:45
another one is
6:48
exact that means approximate numeric
6:51
data type
6:52
exact numeric data approximate means
6:56
again it was divided into
6:59
real data types and
7:02
flow to data types that means which are
7:04
having some decimal points
7:07
okay the attribute which will holds the
7:09
value which consists of some decimal
7:11
points then those attributes should be
7:14
declared by using real or float so what
7:16
is the difference between real and float
7:18
so one difference major difference is
7:20
the range of values so real will support
7:23
up to one range and float will support
7:24
up to one range
7:26
right so exact
7:28
again coming to this exact the first one
7:32
is
7:33
bit either zero or one
7:36
next one
7:37
tiny similar to our real and float there
7:41
are different data types related to this
7:43
exact which are differentiated with the
7:46
range of values that can support right
7:49
so tiny heat
7:52
small inch
7:55
heat
7:59
big it
8:03
decimal
8:05
right so all these are comes under the
8:07
exact exact
8:10
numerator right so all our integers all
8:13
are whole numbers but what is the
8:15
difference means the range so bits are
8:17
nothing but a zero or one tiny means to
8:20
store very less number of values that
8:23
means the range is very less
8:25
and smaller small end is also to store
8:28
the
8:29
normal variable values that means the
8:31
small values which are greater than tiny
8:33
heat
8:34
but less than integer
8:36
similarly begins which can store more
8:38
number of values decimal
8:40
right so the main difference among all
8:42
these things is the range that can
8:45
support
8:46
and strings
8:47
again divided into
8:50
character
8:54
where can
8:58
text
8:59
so here the difference character where
9:01
care and text here here also the
9:03
difference is a range of characters but
9:04
one difference is character means it
9:07
will store the fixed size of variable
9:09
that means once you fix the variable
9:12
size it can't be modified okay but if
9:15
you are using this where care so we can
9:18
modify the size of the data type also so
9:21
we have to mention the size that means
9:23
how many characters that particular
9:25
attribute can hold should be mentioned
9:27
here so that can be modified in the
9:29
background which cannot be done in the
9:31
character
9:32
right so for example if you want to
9:35
store the student name
9:37
so if you use a character data type it
9:40
can hold a fixer size value so we can't
9:42
change okay
9:44
fixed size
9:45
but if you are using some webcam you can
9:47
mention the size so that we can use only
9:49
that particular size for example where
9:51
care of 30 so that implies so this
9:54
particular
9:56
attribute can hold
9:58
a maximum of 30 characters as a student
10:02
name so if you
10:04
if the user wants to give the name which
10:07
is greater than 30 that will not be
10:10
accepted
10:11
okay so that's the major difference
10:13
between the character and the worker so
10:15
text is also similar to
10:17
and here the character means both the
10:19
alpha numeric alpha numeric okay for
10:23
example if you want to store some
10:26
pan number
10:27
on number so we know that a pan number
10:30
will be having the alpha numeric
10:32
variables
10:33
alpha numeric characters okay it is a
10:35
combination of digits and alphabets so
10:38
if you want to
10:40
use a font as an attribute so you have
10:43
to
10:44
declare this fund as
10:47
where can
10:48
so that it will accept
10:50
both the alphabets and the numerical
10:52
values
10:53
right and the last one is a date and a
10:56
time so in order to store the date as
10:59
well as the time as well as a date and
11:01
time so here we again it is classified
11:04
into three categories
11:05
so one is a date
11:08
another one is a time
11:10
another one is a date
11:14
time
11:15
date time so date means it will accept
11:18
the four digit year
11:20
four digit a month
11:22
two sorry two digit month and two digit
11:24
day
11:26
okay and the time will be
11:29
hours
11:30
minutes
11:32
seconds
11:33
and coming to this day time
11:35
it will accept the four digit year two
11:38
digit month
11:39
two digit date
11:41
two digit hours two digit minutes and
11:44
two digits is seconds
11:47
right so
11:48
this is the data date time and date
11:51
so these are all the different data
11:53
types available in sql okay don't get
11:56
confused this is an sql so here
12:00
where we are using this sql the question
12:02
is where we are using this sql so this
12:05
sql will be used in any one of the dbms
12:08
tool
12:10
okay so hope you understood so
12:13
sql will be used in any one of the dbms
12:16
tool what is the dbms tool so we say
12:20
that bbms tool
12:22
means
12:23
already
12:25
sql server
12:29
mysql so all these are the different
12:31
database tools so we are going to use
12:34
this sql
12:35
in one among the dbms tool so
12:39
this dbms tools doesn't support
12:42
all the data types
12:44
okay so these data types will be
12:46
different in different dbms tools now
12:50
let me say the common data types which
12:53
can be used in all the dbms tools
12:57
so the common data types are
13:01
float
13:02
so if you want to store the attribute
13:04
value as a real number that means a
13:06
number with a decimal value so use a
13:09
float so this is accepted in all the
13:11
dbms tools
13:12
next
13:14
integer can be used as integer
13:17
or
13:18
number so this is a common data type
13:22
which can be supported in all the dbms
13:24
tools
13:26
where can
13:27
rarcare is also vacant and the character
13:30
both are also the common data types
13:33
which are used in all the dbms tools
13:36
and similarly this date
13:39
time date time so all these are also the
13:42
common data types which are used in our
13:45
dbms tools any dbm
13:47
so i'll write here
13:51
float
13:54
integer or
13:56
a number
13:58
so here also we can restrict the number
14:00
of digits
14:02
okay
14:02
next character
14:05
where can
14:06
where can
14:07
of size so here we have to mention the
14:10
size
14:13
date
14:15
time
14:19
date so these are the
14:22
common data types which can be supported
14:25
by any dbms tools
14:28
right but
14:29
here you can observe the exact numeric
14:31
data type will be having a lot of
14:33
variations so this is just because of
14:37
size of the variable i mean the size it
14:39
supports
14:40
okay similarly the float and rear also
14:44
right so hope you understood about the
14:46
data types i think you got an idea what
14:49
is the data type and what are the
14:50
different data types
14:52
supported in the sql and what are the
14:54
common data types which are being
14:55
supported by all the dbms tools the
14:59
common data types so float integer
15:01
variable character date time and data
15:04
so in our further sessions we are going
15:06
to use these data types
15:09
so while creating a table we are
15:10
supposed to you give the attributes and
15:13
those attributes do should be defined
15:15
with the help of a corresponding data
15:17
types
15:18
so there we are going to use these data
15:20
types while creating the table
15:22
so based upon this one we have to fill
15:24
the data we have to give the value to
15:26
the attribute so if any value which
15:29
violates this data type automatically it
15:31
will not be accepted
15:32
to the attribute
15:35
right so hope you understood the data
15:37
type supported in sql and the
15:40
common data types which are supported by
15:42
all the dbms tools so let's stop here
15:45
and uh
15:46
hope you understood this one and enjoyed
15:48
the session so if you really enjoyed my
15:50
session like my session share my session
15:51
with your friends and if you are having
15:53
any doubts regarding this one feel free
15:54
to post your doubts in the comment
15:56
section and don't forget to subscribe to
15:58
our channel thanks for watching thank
16:00
you very much