Domain Types in SQL

SQL has the following domain types:

  • char(n): Fixed length character string, with user-specified length n

  • varchar(n): Variable length character strings, with user-specified maximum length n

  • int: Integer

  • smallint: Small integer

  • numeric(p,d): Fixed point number, with user-specified precision of p digits, with d digits to the right of decimal point

  • real, double precision: Floating point and double-precision floating point numbers, with machine-dependent precision

  • float(n): Floating point number, with user-specified precision of at least n digits

  • More domains such as time and date are covered later

Last updated