SQL Data Types

A SQL is a database language and same as other programming languages, SQL also have different types of Data Types.

The data types are defined while creating a table in a database. The data type of the column defines, what type of value that column can hold.

It might be the character, string, number, image, date and time.

Each column in a database table is required to have a name and a data type. The Basic datatypes are char, string, integer, decimal, date and time etc.

Being an SQL developer, you must have decide what type of data that will be stored inside each column when creating a table.

The data type is 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.

Below are Some important data types that supports in MySQL, SQL Server and Oracle.

MySQL Data Types

  • CHAR(size)
  • VARCHAR(size)
  • INTEGER(size)
  • FLOAT(size, d)
  • DOUBLE(size, d)
  • DECIMAL(size, d)
  • DATE
  • DATETIME(fsp)
  • TIMESTAMP(fsp)
  • TIME(fsp)
  • YEAR

SQL Server Data Types

  • char(n)
  • varchar(n)
  • text
  • image
  • int
  • decimal(p,s)
  • numeric(p,s)
  • real
  • float(n)
  • datetime
  • timestamp

Oracle Data Types

  • CHAR(size)
  • VARCHAR2(size)
  • NUMBER(p, s)
  • FLOAT(p)
  • DATE
  • TIMESTAMP
Previous Post Next Post

Contact Form