SQL Data Types

Basic data types of SQL with specification on the Postgres database platform as listed below:

Char(n) : Character string, with a fixed-length (n).

Varchar(n): Character string, with variable length, but the maximum length is (n).

Binary(n): Binary string, with fixed-length (n).

Boolean: Stores either true or false values.

Int Integer(p): Integer numerical (no decimal), with precision p.

Float(p): Known as Int Integer in PostgreSQL. Approximate numerical, with mantissa precision p, that is essentially a floating number in base 10 exponential notation.

Date: Stores year, month and day values

Time: Stores hour minute and second values

TimeStamp: Stores year, month, day, hour, minute and second values.

Interval: Composed of a number of integer fields, representing a period of time, depending on the type of interval.

Array: A set-length and ordered collection of elements.

Multiset: A variable-length and unordered collection of elements

XML: Stores XML data.

Money: Specific to PostgreSQL and SQLServer, the money datatype stores currency amount. Input comes in three different types of formats, including integer, floating-point literals and currency formatting, such as ‘$500.00’. The output is generally in currency formats.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.