SQL – Data Types

Most Common used SQL Data types

char(n) : Fixed n numbers of characters accepted(Memory will be Allocated for n character at the time of creation). Max 8,000 characters allowed.

varchar(n) : Variable n numbers of characters accepted(Memory will be Allocated for the character at run time). Max 8,000 characters allowed.

int : Range – whole numbers from 2,147,483,648 to 2,147,483,647
bigint : Range – whole numbers from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
smallint : Range – whole numbers from -32,768 32,767
tinyint : Range – whole numbers from 0 to 255
decimal : Range Allows decimal numbers from -10^38 +1 to 10^38 -1
numeric : Allows numbers from -10^38 +1 to 10^38 –1.

text : Variable character string. Maximum 2GB of text data can be accepted.
nchar : Fixed size Unicode string. Maximum 4,000 characters allowed.
nvarchar :Variable size Unicode string. Maximum 4,000 characters allowed.

datetime : Range – From 31 Jan, 1753 to Dec 31, 9999
date : Stores date a date From January 1, 0001 to December 31, 9999
time : Store a time example : 1:00 PM


Advertisements

Add Comment

📖 Read More