What Data types are available in
SQL?
What is SQL ??
Tired of not knowing what SQL is? Well, SQL stands
for Structured Query Language;
it is an
SQL statements are used to retrieve data in a database.
What
about manipulating database systems??
That is , SQL statements are also used to
update data in a database.
What are data types ??
In a database system, each object (such as column,
variable, or parameter) has a related data type which refers to an attribute that specifies the type of
data that the object can hold. SQL works with database programs like MS
Access, MS SQL Server, Oracle, Sybase, etc. Therefore there are different types
of SQL for different database programs. But since we are using the Oracle
database system, I will be concentrating on SQL data types in the Oracle
database system.
But data
types can be categorized as:
This is an example of a SQL command defining the
data types for these objects:
CREATE TABLE
registrations (
username
emailAddress
zipCode
age
gender
);
While these table is by no means complete, the
following table outlines some of the common names of data types between the
various database platforms:
|
Access |
SQL-Server |
Oracle |
MySQL |
PostgreSQL |
boolean |
Yes/No |
Bit |
Byte |
N/A |
Boolean |
integer |
Number (integer) |
Int |
Number |
Int |
Integer |
float |
Number (single) |
Float |
Number |
Float |
Numeric |
currency |
Currency |
Money |
N/A |
N/A |
Money |
string (fixed) |
N/A |
Char |
Char |
Char |
Char |
string (variable) |
Text (<256) |
Varchar |
Varchar |
Varchar |
Varchar |
binary object |
OLE Object |
Binary (fixed up to 8K) |
Long Raw |
Blob |
Binary |
References: