Search This Blog

SQL: Data Types

 

SQL: Data Types

oracle sql


This SQL tutorial provides a list of general SQL datatypes. These data types may not be supported by all relational databases.

Data Type SyntaxExplanation (if applicable)
integer 
smallint 
numeric(p,s)Where p is a precision value; s is a scale value. For example, numeric(6,2) is a number that has 4 digits before the decimal and 2 digits after the decimal.
decimal(p,s)Where p is a precision value; s is a scale value.
realSingle-precision floating point number
double precisionDouble-precision floating point number
float(p)Where p is a precision value.
char(x)Where x is the number of characters to store. This data type is space padded to fill the number of characters specified.
varchar(x)Where x is the number of characters to store. This data type does NOT space pad.
bit(x)Where x is the number of bits to store.
bit varying(x)Where x is the number of bits to store. The length can vary up to x.
dateStores year, month, and day values.
timeStores the hour, minute, and second values.
timestampStores year, month, day, hour, minute, and second values.
time with time zoneExactly the same as time, but also stores an offset from UTC of the time specified.
timestamp with time zoneExactly the same as timestamp, but also stores an offset from UTC of the time specified.
year-month intervalContains a year value, a month value, or both.
day-time intervalContains a day value, an hour value, a minute value, and/or a second value.

No comments:

Post a Comment

Using SQL*Plus to Unlock Accounts and Reset Passwords

  Using SQL*Plus to Unlock Accounts and Reset Passwords Use this SQL*Plus procedure to unlock and reset user account passwords. Log in as th...