0% found this document useful (0 votes)
0 views3 pages

SQL DBMS Data Types

SQL data types are categorized into numeric, date and time, character and string, Unicode character string, and binary types. Character and string types include CHAR, VARCHAR, and TEXT, while numeric types range from BIT to BIGINT with specific value limits. Date and time types include DATE, TIME, DATETIME, TIMESTAMP, and YEAR, each with defined formats and ranges.

Uploaded by

nicolekaveso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

SQL DBMS Data Types

SQL data types are categorized into numeric, date and time, character and string, Unicode character string, and binary types. Character and string types include CHAR, VARCHAR, and TEXT, while numeric types range from BIT to BIGINT with specific value limits. Date and time types include DATE, TIME, DATETIME, TIMESTAMP, and YEAR, each with defined formats and ranges.

Uploaded by

nicolekaveso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SQL Data Types

SQL data types can be broadly divided into following categories.

 Numeric data types such as int, tinyint, bigint, float, real etc.
 Date and Time data types such as Date, Time, Datetime etc.
 Character and String data types such as char, varchar, text etc.
 Unicode character string data types, for example nchar, nvarchar, ntext etc.
 Binary data types such as binary, varbinary etc.
SQL Character and String Data Types
Datatype Description

CHAR Fixed length with maximum length of 8,000


characters

VARCHAR Variable length storage with maximum


length of 8,000 characters

VARCHAR(max) Variable length storage with provided max


characters, not supported in MySQL

TEXT Variable length storage with maximum size


of 2GB data
SQL Numeric Data Types

Datatype From To

bit 0 1

tinyint 0 255

smallint -32,768 32,767

int -2,147,483,648 2,147,483,647

bigint -9,223,372,036,854,775,808 9,223,372,036,854,775,807

decimal -10^38 +1 10^38 -1

numeric -10^38 +1 10^38 -1

float -1.79E + 308 1.79E + 308

real -3.40E + 38 3.40E + 38


SQL Date and Time Data Types

DATE Stores date in the format YYYY-MM-DD

TIME Stores time in the format HH:MI:SS

DATETIME Stores date and time information in the


format YYYY-MM-DD HH:MI:SS

TIMESTAMP Stores number of seconds passed since the


Unix epoch (‘1970-01-01 00:00:00’ UTC)

YEAR Stores year in 2 digit or 4 digit format.


Range 1901 to 2155 in 4-digit format. Range
70 to 69, representing 1970 to 2069.

You might also like