SQL Server Data Types - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
SQL Server Data Types

SQL Server Data Types

SQL Server Data Types

Each column in a database table is required to have a name and a data type.
SQL developers have to decide what types of data will be stored inside each and every table column when creating a SQL table. The data type is a label and a guideline for SQL to understand what type of data is expected inside of each column, and it also identifies how SQL will interact with the stored data.
The following table lists the general data types in SQL:
Data typeDescription
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
BOOLEANStores TRUE or FALSE values
VARBINARY(n) or
BINARY VARYING(n)
Binary string. Variable length. Maximum length n
INTEGER(p)Integer numerical (no decimal). Precision p
SMALLINTInteger numerical (no decimal). Precision 5
INTEGERInteger numerical (no decimal). Precision 10
BIGINTInteger numerical (no decimal). Precision 19
DECIMAL(p,s)Exact numerical, precision p, scale s. Example: decimal(5,2) is a number that has 3 digits before the decimal and 2 digits after the decimal
NUMERIC(p,s)Exact numerical, precision p, scale s. (Same as DECIMAL)
FLOAT(p)Approximate numerical, mantissa precision p. A floating number in base 10 exponential notation. The size argument for this type consists of a single number specifying the minimum precision
REALApproximate numerical, mantissa precision 7
FLOATApproximate numerical, mantissa precision 16
DOUBLE PRECISIONApproximate numerical, mantissa precision 16
DATEStores year, month, and day values
TIMEStores hour, minute, and second values
TIMESTAMPStores year, month, day, hour, minute, and second values
INTERVALComposed of a number of integer fields, representing a period of time, depending on the type of interval
ARRAYA set-length and ordered collection of elements
MULTISETA variable-length and unordered collection of elements
XMLStores XML data

About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.