Member-only story
SQL (Structured Query Language) supports several data types that allow you to define the type of data that can be stored in a database table. The exact list of data types can vary slightly between database management systems (DBMS) because each DBMS may have its own set of extensions or variations. However, I’ll provide a common list of SQL data types:
1. Numeric Types:
INT
orINTEGER
: Integer type.SMALLINT
: Small integer.BIGINT
: Large integer.DECIMAL
orNUMERIC
: Exact numeric with a specified precision and scale.FLOAT
: Floating-point number.REAL
: Single-precision floating-point number.DOUBLE
orDOUBLE PRECISION
: Double-precision floating-point number.
2. Character String Types:
CHAR(n)
: Fixed-length character string.VARCHAR(n)
: Variable-length character string with a maximum length.TEXT
: Variable-length character string with no maximum length.
3. Date and Time Types:
DATE
: Date only.TIME
: Time only.DATETIME
orTIMESTAMP
: Date and time.