Types of constants in SQL: numeric, string, symbolic, date, time

Constants in SQL: Constants are numeric characters or values used in a SQL statement.

For Example:


Here, 1020 is a constant.

Types of constants in SQL:

Numeric constants: Numeric constants are integer and decimal numeric values.

For Example:

  • 45
  • 36.00
  • -83
  • $2000
  • $100.86
  • 2.8E6
  • 5.2E-3

where, E is: times ten to the power of

String constants: String constants are constants for character data.

For Example:

‘More Process’

For a quote, two single quotes are used.

For Example:


Symbolic constants: Symbolic constants are used to return data value which are managed by the database management system.

For Example: CURRENT_DATE is used to return current date.

Date and Time constants: Date and Time constants are constants for date and time.

For SQL Server, some date constants are:

  • March 4, 2013
  • Mar 4 2013
  • 3/4/2013
  • 2013 MAR 4

For SQL Server, some time constants are:

  • 5:45:40
  • 5:45:40 AM
  • 5:45:40 am
  • 5 am

Leave a Reply