This page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & Trudy Pelzer. The authors have graciously allowed us to reproduce the contents of the book here. Because the book is about the SQL-99 standard, the contents of this and other pages in the book may not directly apply to MariaDB. Use the navigation bar to navigate the book.
In SQL, a character string is any sequence of zero or more alphanumeric characters that belong to a given Character set. A Character set is a named character repertoire that includes a Form-of-use encoding scheme which defines how the repertoire's characters are encoded as numbers. The SQL Standard defines several standard Character sets that your DBMS must support. A character string value may be a <literal>, an <identifier>, the value of a parameter or a host language variable or the result of any expression or argument that evaluates to a character string. All character strings belong to some Character set and are governed by the rules of some Collation during comparisons. A Collation is a named collating sequence. Character strings that belong to the same Character set are compatible.
A character string has a length: a non-negative integer equal to the number of
characters in the string. Characters in a character string are numbered (from
left to right), beginning with 1. A Character string also has a coercibility
attribute; this helps your DBMS determine which Collation to use for a
comparison that doesn't provide an explicit
The coercibility attribute can be either
COLLATION. (A coercibility attribute of
IMPLICIT means the string has
a current default Collation. A coercibility attribute of
NO COLLATION means the string does not have a current
default Collation.) Character strings are stored in either of the six character
string <data type>s:
CHARACTER LARGE OBJECT,
NATIONAL CHARACTER VARYING or
NATIONAL CHARACTER LARGE OBJECT.
Character String <literal>sThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
Character String <data type>sThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
Character String OperationsThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
Character Strings and Character SetsThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
Character Strings and CollationsThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
DialectsThis page is part of the book SQL-99 Complete, Really, by Peter Gulutzan & ...
Table 7.1Collating Sequences and Coercibility Rules for Monadic Operations OPERAND'...
Table 7.2Collating Sequences and Coercibility Rules for Dyadic Operations OPERAND_1...
Table 7.3Collating Sequences used for Comparisons COMPARAND_1'S COERCIBILITY ATTRIB...