bing
Flat 10% & upto 50% off + Free additional Courses. Hurry up!

SQL Data Types

 

Each DBMS defines its own SQL types.

SQL type identifier Typical SQL datatype     Description
SQL_CHAR CHAR(n) Character string of fixed string length n.
SQL_VARCHAR VARCHAR(n) Variable-length character string with a maximum string length n.
SQL_LONGVARCHAR LONG VARCHAR Variable length character data. Maximum length is data source–dependent.[9]
SQL_WCHAR WCHAR(n) Unicode character string of fixed string length n
SQL_WVARCHAR VARWCHAR(n) Unicode variable-length character string with a maximum string length n
SQL_WLONGVARCHAR LONGWVARCHAR Unicode variable-length character data. Maximum length is data source–dependent
SQL_DECIMAL DECIMAL(p,s) Signed, exact, numeric value with a precision of at least p and scale s. 
SQL_NUMERIC NUMERIC(p,s) Signed, exact, numeric value with aprecision p and scale s
SQL_SMALLINT SMALLINT Exact numeric value with precision 5 and scale 0
SQL_INTEGER INTEGER Exact numeric value with precision 10 and scale 0
SQL_REAL REAL Signed, approximate, numeric value with a binary precision
SQL_FLOAT FLOAT(p) Signed, approximate, numeric value with a binary precision of at least p.
SQL_DOUBLE DOUBLE PRECISION Signed, approximate, numeric value with a binary precision 53
SQL_BIT BIT Single bit binary data.
SQL_TINYINT TINYINT Exact numeric value with precision 3 and scale 0
SQL_BIGINT BIGINT Exact numeric value with precision 19 (if signed) or 20 (if unsigned) and scale 0
SQL_BINARY BINARY(n) Binary data of fixed length n.
SQL_VARBINARY VARBINARY(n) Variable length binary data of maximum length n. The maximum is set by the user.
SQL_LONGVARBINARY LONG VARBINARY Variable length binary data. Maximum length is data source–dependent.
SQL_TYPE_DATE DATE Year, month, and day fields, conforming to the rules of the Gregorian calendar.
SQL_TYPE_TIME TIME(p) Hour, minute, and second fields, with valid values for hours of 00 to 23, valid values for minutes of 00 to 59, and valid values for seconds of 00 to 61. Precision p indicates the seconds precision.
SQL_TYPE_TIMESTAMP TIMESTAMP(p) Year, month, day, hour, minute, and second fields, with valid values as defined for the DATE and TIME data types.
SQL_TYPE_UTCDATETIME UTCDATETIME Year, month, day, hour, minute, second, utchour, and utcminute fields. The utchour and utcminute fields have 1/10 microsecond precision.
SQL_TYPE_UTCTIME UTCTIME Hour, minute, second, utchour, and utcminute fields. The utchour and utcminute fields have 1/10 microsecond precision..
SQL_INTERVAL_MONTH INTERVAL MONTH(p) Number of months between two dates; p is the interval leading precision.
SQL_INTERVAL_YEAR INTERVAL YEAR(p) Number of years between two dates; p is the interval leading precision.
SQL_INTERVAL_YEAR_TO_MONTH INTERVAL YEAR(p) TO MONTH Number of years and months between two dates; p is the interval leading precision.
SQL_INTERVAL_DAY INTERVAL DAY(p) Number of days between two dates; p is the interval leading precision.
SQL_INTERVAL_HOUR INTERVAL HOUR(p) Number of hours between two date/times; p is the interval leading precision.
SQL_INTERVAL_MINUTE INTERVAL MINUTE(p) Number of minutes between two date/times; p is the interval leading precision.
SQL_INTERVAL_SECOND INTERVAL SECOND(p,q) Number of seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
SQL_INTERVAL_DAY_TO_HOUR INTERVAL DAY(p) TO HOUR Number of days/hours between two date/times; p is the interval leading precision.
SQL_INTERVAL_DAY_TO_MINUTE INTERVAL DAY(p) TO MINUTE Number of days/hours/minutes between two date/times; p is the interval leading precision.
SQL_INTERVAL_DAY_TO_SECOND INTERVAL DAY(p) TO SECOND(q) Number of days/hours/minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
SQL_INTERVAL_HOUR_TO_MINUTE INTERVAL HOUR(p) TO MINUTE Number of hours/minutes between two date/times; p is the interval leading precision.
SQL_INTERVAL_HOUR_TO_SECOND INTERVAL HOUR(p) TO SECOND(q) Number of hours/minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
SQL_INTERVAL_MINUTE_TO_SECOND INTERVAL MINUTE(p) TO SECOND(q) Number of minutes/seconds between two date/times; p is the interval leading precision and q is the interval seconds precision.
SQL_GUID GUID Fixed length GUID.

"0 Responses on SQL Data Types"

Training in Cities

Bangalore, Hyderabad, Chennai, Delhi, Kolkata, UK, London, Chicago, San Francisco, Dallas, Washington, New York, Orlando, Boston

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

top

Sales Offer

  • To avail this offer, enroll before 05th December 2016.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer
offer-june

Sign Up or Login to view the Free SQL Data Types.