Sunday, 22 November 2020

List the data types that are allowed for SQL attributes.

 Question: 4.2. List the data types that are allowed for SQL attributes. 

Solution:

Numeric data types

Integer numbers

  • INT
  • INTEGER
  • SMALLINT
  • BIGINT

Floating-point (real) numbers

  • REAL
  • DOUBLE
  • FLOAT

Fixed-point numbers

  • DECIMAL(n,m)
  • DEC(n,m)
  • NUMERIC(n,m)
  • NUM(n,m)

Character-string data types

Fixed length

  • CHAR(n)
  • CHARACTER(n)

Varying length

  • VARCHAR(n)
  • CHAR VARYING(n)
  • CHARACTER VARYING(n)

Long varchar

Large object data types

Characters:

CLOB

CHAR LARGE OBJECT

CHARACTER LARGE OBJECT

Bits

BLOB

BINARY LARGE OBJECT

Boolean data type

Values of TRUE or FALSE or NULL

DATE data type

Ten positions

Components are YEAR, MONTH, and DAY in the form YYYY-MM-DD

No comments:

Post a Comment