A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Types of sql

BOOLEAN
BOOLEAN

There is boolean data type in SQL Server. Its values can be TRUE, FALSE or UNKNOWN. However, the boolean data type is only the result of a boolean expression containing some combination of comparison operators (e.g. =, <>, <, >=) or logical operators (e.g. AND, OR, IN, EXISTS).

CHARACTER [(Length)] or CHAR [(Length)]
CHARACTER [(Length)] or CHAR [(Length)]

querying WHERE condition to character length? ... for MySQL there's the CHAR_LENGTH(). ... Best practices for SQL varchar column length. 1.

image: sqlinfo.in
DECIMAL [(p[,s])] or DEC [(p[,s])]
DECIMAL [(p[,s])] or DEC [(p[,s])]

recently, while working on a db2 -> oracle migration project, we came across this situation. the developers were inadvertently creating new table structures using decimal(s,p) columns.

INTEGER or INT
INTEGER or INT

The difference between int and integer is that int is a data type, but integer is a group of data types – e.g. int, long, short and byte.

NUMERIC [(p[,s])]
NUMERIC [(p[,s])]

Numeric datatype in TSQL: http://msdn.microsoft.com/en-us/library/ms187746.aspx According to the definition and article in the link above, Scale in a numeric datatype is the maximum number of decimal digits that can be stored to the right of the decimal point. Scale must be a value from 0 through p.

REAL
REAL

When you want to convert from float or real to character data, using the STR string function is usually more useful than CAST( ). This is because STR enables more control over formatting. For more information, see STR (Transact-SQL) and Functions (Transact-SQL).

SMALLINT
SMALLINT

The int data type is the primary integer data type in SQL Server. The bigint data type is intended for use when integer values might exceed the range that is supported by the int data type. bigint fits between smallmoney and int in the data type precedence chart.

VARCHAR (Length)
VARCHAR (Length)

For SQL Server I could not find a clear statement on this but the execution time to increase the size of a varchar column (again the 1.2 million rows table from above) indicates that no rewrite takes place.

Related Facts