O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Character String Types

Use character string data types to represent text. A character string, or just string, has these characteristics:

  • It’s an ordered sequence of zero or more characters.

  • Its length can be fixed or varying.

  • It’s case-sensitive ('A' comes before 'a' when sorted).

  • In SQL statements, a string literal is surrounded by single quotes.

  • It’s one of the types listed in Table 3.5.

Table 3.5. Character String Types
TYPEDESCRIPTION
CHARACTERRepresents a fixed number of characters. A string stored in a column defined as CHARACTER(length) can have up to length characters, where length is a number (integer) greater than or equal to 1; the maximum length depends on the DBMS. When you store a string with fewer than length characters in a CHARACTER( ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required