Data types tells the computer the type of data which is going to be processed and
amount of memory which should be allocated to that data.The datatype can be
Integer, Character, Text, Date etc,
Each column in a database should be mentioned with proper datatype to ensure
proper insertion of data in a column.Let us see the types of data available in SQL
Basically there are three main types of Data. String, Numeric and date and time.
1. String Data Type :
a. Text(size): Holds a string of maximum length of 65535 bytes
b. Char(size): Holds letters, numbers, special characters . It is a fixed length
string
c.Varchar(size): Holds variable length string including letters, numbers,
special characters
2. Numeric Data Types:
a.Bit(size): Holds Bit value type. The size of the parameter can hold 1 to 64
b.INT(size): Holds medium Integer.
c. Float(size,d) :Holds floating point number. The number of digits is specified
in d as parameter.
d.Double(size,d) :A normal size floating point number. The number of digits is
specified in d as parameter.
3. Date and Time:
a. Date: Display in date format(yyyy-mm-dd)
b Date and Time: Display in date and time combination(yyyy-mm-dd hh:mm:ss)
c. time(fsp): Display in time format(hh:mm:ss)
Note:Datatypes have different names in different database.The size and other details
may also vary.so it is always recommended to go through the documentation.
No comments:
Post a Comment