Data types of SQL

data type of SQL shows that which type of value is stored in a particular column of a table exist in data base.
we know that every column/field of a table/relation must have a name, data type and size. it is responsibility of developer to decide data type of each column as per need. data type are labels or guidelines of SQL, on the basis of which SQL commands will interact with columns. following table represents general data type names and their description -


Data Type
Description
CHARACTER (N)
Character, string fixed length N.
VARCHAR (N) OR CHARACTER VARYING (N)
Character, string variable length, maximum length N.
BINARY (N)
Binary string fixed length N.
VARBINARY (N) OR BINARY VARYING (N)
Binary string variable length maximum length N.
BOOLEAN
Stores Boolean value true or false.
INTEGER (N)
Integer numerical (no decimal point) precision p.
DECIMAL (P,S) OR NUMERIC (P,S) OR NUMBER (P,S)
Exact numerical precision p, scale s.
FLOAT (P)
Approximately numerical precision p.
DATE
Stores year, month and day values.
TIME
Stores hour, minute and second values.
TIME STAMP
Stores year, month, day, hour, minute and second values.
ARRAY
A set length and ordered of collection of elements.
XML
Stores XML data etc.

No comments:

Post a Comment

Nested SQL Query or SQL Sub Query in hindi in english

if a SQL query is used inside another SQL query then this type of SQL query is called sub-query.  यदि किसी SQL क्वेरी का उपयोग, किसी अन्य SQ...