SQL basics- complete reference guide - part3 - Data Types in SQL

Part3: SQL Data Types Reference

TOPICTEXTSYNTAXExample
INT TypePossible values: -2147483648 to 2147483647.INT | INTEGER | MEDIUMINT | INT4 | SIGNED
BOOLEAN TypePossible values: TRUE and FALSE.BOOLEAN | BIT | BOOL
TINYINT TypePossible values are: -128 to 127.TINYINT
SMALLINT TypePossible values: -32768 to 32767.SMALLINT | INT2 | YEAR
BIGINT TypePossible values: -9223372036854775808 to 9223372036854775807.BIGINT | INT8
IDENTITY TypeAuto-Increment value.IDENTITY
DECIMAL TypeData type with fixed precision and scale.{ DECIMAL | NUMBER | DEC | NUMERIC } ( precisionInt [ , scaleInt ] )
DOUBLE TypeFloating point number.{ DOUBLE [ PRECISION ] | FLOAT | FLOAT4 | FLOAT8 }
REAL TypeSingle precision floating point number.REAL
TIME TypeThe format is hh:mm:ss.TIME
DATE TypeThe format is yyyy-MM-dd.DATE
TIMESTAMP TypeThe format is yyyy-MM-dd hh:mm:ss[.{ TIMESTAMP | DATETIME | SMALLDATETIME }
BINARY TypeRepresents a byte array.{ BINARY | VARBINARY | LONGVARBINARY | RAW | BYTEA } [ ( precisionInt ) ]
OTHER TypeThis type allows storing serialized Java objects.OTHER
VARCHAR TypeUnicode String.{ VARCHAR | LONGVARCHAR | VARCHAR2 | NVARCHAR
    | NVARCHAR2 | VARCHAR_CASESENSITIVE}  [ ( precisionInt ) ]
VARCHAR_IGNORECASE TypeSame as VARCHAR, but not case sensitive when comparing.VARCHAR_IGNORECASE [ ( precisionInt ) ]
CHAR TypeThis type is supported for compatibility with other databases and older
applications.
{ CHAR | CHARACTER | NCHAR } [ ( precisionInt ) ]
BLOB TypeLike BINARY, but intended for very large values such as files or images.{ BLOB | TINYBLOB | MEDIUMBLOB | LONGBLOB | IMAGE | OID } [ ( precisionInt ) ]
CLOB TypeCLOB is like VARCHAR, but intended for very large values.{ CLOB | TINYTEXT | TEXT | MEDIUMTEXT | LONGTEXT | NTEXT | NCLOB } [ ( precisionInt ) ]
UUID TypeUniversally unique identifier.UUID
ARRAY TypeAn array of values.ARRAY

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...