Small. Fast. Reliable.
Choose any three.

SQLite Requirement Matrix Details
lang_expr.html

Index Summary Markup Original


R-52150-45231-03638-58304-20308-49186-22409-26658 tcl slt th3 src

[expr]    + [expr]    - [expr]

/* IMP: R-52150-45231 */
# EVIDENCE-OF: R-52150-45231
# ~ [expr]    + [expr]    - [expr]

R-60266-38679-12997-49105-31919-12013-36067-05983 tcl slt th3 src

[expr] COLLATE (collation-name) 3

/* IMP: R-60266-38679 */
# EVIDENCE-OF: R-60266-38679
# [expr] COLLATE (collation-name) 3

R-63829-15770-44431-02464-62673-04541-39910-55910 tcl slt th3 src

||   ->   ->>

/* IMP: R-63829-15770 */
# EVIDENCE-OF: R-63829-15770
# ||   ->   ->>

R-30993-34769-34709-09783-22387-24850-31587-36947 tcl slt th3 src

*   /   %

/* IMP: R-30993-34769 */
# EVIDENCE-OF: R-30993-34769
# *   /   %

R-18642-55679-55028-13140-51335-34498-19379-38199 tcl slt th3 src

+   -

/* IMP: R-18642-55679 */
# EVIDENCE-OF: R-18642-55679 +   -

R-30730-49369-63435-09885-16429-36568-35219-46599 tcl slt th3 src

&  |   <<  >>

/* IMP: R-30730-49369 */
# EVIDENCE-OF: R-30730-49369
# &&ensp;&nbsp;|&nbsp;&nbsp;&nbsp;<<&ensp;&nbsp;>>

R-17663-53610-53053-19018-07055-34524-04092-57250 tcl slt th3 src

[expr] ESCAPE [escape-character-expr] 4

/* IMP: R-17663-53610 */
# EVIDENCE-OF: R-17663-53610
# &lsqb;expr&rsqb;&nbsp;ESCAPE&nbsp;&lsqb;escape-character-expr&rsqb;&nbsp;4

R-07877-15664-12195-18101-28261-58397-21882-37632 tcl slt th3 src

<  >  <=  >=

/* IMP: R-07877-15664 */
# EVIDENCE-OF: R-07877-15664
# <&nbsp;&nbsp;>&nbsp;&nbsp;<=&nbsp;&nbsp;>=

R-47617-35714-52231-13731-24138-59751-09512-27387 tcl slt th3 src

=  ==  <>  !=  IS   IS NOT
IS DISTINCT FROM   IS NOT DISTINCT FROM
[expr] BETWEEN5 [expr] AND [expr]
IN5  MATCH5  LIKE5  REGEXP5  GLOB5
[expr] ISNULL  [expr] NOTNULL   [expr] NOT NULL

/* IMP: R-47617-35714 */
# EVIDENCE-OF: R-47617-35714
# =&nbsp;&nbsp;==&nbsp;&nbsp;<>&nbsp;&nbsp;!=&nbsp;&nbsp;IS&nbsp;&nbsp;&nbsp;IS&nbsp;NOT IS&nbsp;DISTINCT&nbsp;FROM&nbsp;&nbsp;&nbsp;IS&nbsp;NOT&nbsp;DISTINCT&nbsp;FROM &lsqb;expr&rsqb;&nbsp;BETWEEN5&nbsp;&lsqb;expr&rsqb;&nbsp;AND&nbsp;&lsqb;expr&rsqb;&ensp; IN5&nbsp;&nbsp;MATCH5&nbsp;&nbsp;LIKE5&nbsp;&nbsp;REGEXP5&nbsp;&nbsp;GLOB5 &lsqb;expr&rsqb;&nbsp;ISNULL&nbsp;&nbsp;&lsqb;expr&rsqb;&nbsp;NOTNULL&nbsp;&nbsp;&nbsp;&lsqb;expr&rsqb;&nbsp;NOT&nbsp;NULL

R-04319-15719-25184-39391-34857-08378-25938-61805 tcl slt th3 src

NOT

/* IMP: R-04319-15719 */
# EVIDENCE-OF: R-04319-15719 NOT

R-21903-64655-22384-55524-63839-20952-08808-21810 tcl slt th3 src

AND

/* IMP: R-21903-64655 */
# EVIDENCE-OF: R-21903-64655 AND

R-07424-59356-59026-59612-16232-30704-13795-42518 tcl slt th3 src

OR

/* IMP: R-07424-59356 */
# EVIDENCE-OF: R-07424-59356 OR

R-42928-04804-58667-56106-39404-50461-35993-01252 tcl slt th3 src

The COLLATE clause (with its collation-name) acts as a single postfix operator.

/* IMP: R-42928-04804 */
# EVIDENCE-OF: R-42928-04804 The COLLATE clause (with its
# collation-name) acts as a single postfix operator.

R-11093-24211-58889-40188-52881-41669-64989-17738 tcl slt th3 src

The ESCAPE clause (with its escape character) acts as a single postfix operator.
  It can only bind to a preceding [expr] LIKE [expr] expression.

/* IMP: R-11093-24211 */
# EVIDENCE-OF: R-11093-24211 The ESCAPE clause (with its escape
# character) acts as a single postfix operator. &nbsp;&nbsp;It
# can only bind to a preceding &lsqb;expr&rsqb; LIKE
# &lsqb;expr&rsqb; expression.

R-62393-40130-05816-02301-40673-52787-58252-12713 tcl slt th3 src

Each keyword in (BETWEEN IN GLOB LIKE MATCH REGEXP) may be prefixed
  by NOT, retaining the bare operator's precedence and associativity.

/* IMP: R-62393-40130 */
# EVIDENCE-OF: R-62393-40130 Each keyword in (BETWEEN IN GLOB LIKE MATCH
# REGEXP) may be prefixed &nbsp;&nbsp;by NOT, retaining the bare
# operator's precedence and associativity.

R-59577-33471-39346-45414-34609-60012-12077-11853 tcl slt th3 src

The COLLATE operator is a unary postfix operator that assigns a collating sequence to an expression.

tcl/e_expr.test:365

/* IMP: R-59577-33471 */
# EVIDENCE-OF: R-59577-33471 The COLLATE operator is a unary postfix
# operator that assigns a collating sequence to an expression.

R-58731-25439-21347-45819-04127-12492-10479-51386 tcl slt th3 src

The collating sequence set by the COLLATE operator overrides the collating sequence determined by the COLLATE clause in a table column definition.

tcl/e_expr.test:403

/* IMP: R-58731-25439 */
# EVIDENCE-OF: R-58731-25439 The collating sequence set by the COLLATE
# operator overrides the collating sequence determined by the COLLATE
# clause in a table column definition.

R-53670-03373-29503-41803-42706-56849-33971-45159 tcl slt th3 src

The unary operator + is a no-op.

tcl/e_expr.test:194

/* IMP: R-53670-03373 */
# EVIDENCE-OF: R-53670-03373 The unary operator + is a no-op.

R-19480-30968-40912-48323-17771-07927-20882-34034 tcl slt th3 src

It can be applied to strings, numbers, blobs or NULL and it always returns a result with the same value as the operand.

tcl/e_expr.test:196

/* IMP: R-19480-30968 */
# EVIDENCE-OF: R-19480-30968 It can be applied to strings, numbers,
# blobs or NULL and it always returns a result with the same value as
# the operand.

R-03679-60639-59233-10900-40024-64867-37353-18498 tcl slt th3 src

Equals can be either = or ==.

tcl/e_expr.test:216

/* IMP: R-03679-60639 */
# EVIDENCE-OF: R-03679-60639 Equals can be either = or ==.

R-49372-18364-40591-37622-07295-31685-37955-59383 tcl slt th3 src

The not-equal operator can be either != or <>.

tcl/e_expr.test:218

/* IMP: R-49372-18364 */
# EVIDENCE-OF: R-49372-18364 The not-equal operator can be either != or
# <>.

R-44409-62641-17041-24104-11614-63008-35007-15423 tcl slt th3 src

The || operator is "concatenate" - it joins together the two strings of its operands.

tcl/e_expr.test:241

/* IMP: R-44409-62641 */
# EVIDENCE-OF: R-44409-62641 The || operator is "concatenate" - it joins
# together the two strings of its operands.

R-24636-24567-22632-41187-02492-09181-21394-55027 tcl slt th3 src

The -> and ->> operators are "extract"; they extract the RHS component from the LHS.

/* IMP: R-24636-24567 */
# EVIDENCE-OF: R-24636-24567 The -> and ->> operators are
# "extract"; they extract the RHS component from the LHS.

R-53431-59159-09911-22042-14613-41147-21418-31229 tcl slt th3 src

The % operator casts both of its operands to type INTEGER and then computes the remainder after dividing the left integer by the right integer.

tcl/e_expr.test:257

/* IMP: R-53431-59159 */
# EVIDENCE-OF: R-53431-59159 The % operator casts both of its operands
# to type INTEGER and then computes the remainder after dividing the
# left integer by the right integer.

R-15904-00746-56156-46243-28663-24468-25045-59093 tcl slt th3 src

The result of any binary operator is either a numeric value or NULL, except for the || concatenation operator, and the -> and ->> extract operators which evaluate to either NULL or a text value.

tcl/e_expr.test:268

/* IMP: R-15904-00746 */
# EVIDENCE-OF: R-15904-00746 The result of any binary operator is either
# a numeric value or NULL, except for the || concatenation operator, and
# the -> and ->> extract operators which evaluate to either
# NULL or a text value.

R-24731-45773-21654-50701-01955-60961-16210-17736 tcl slt th3 src

The IS and IS NOT operators work like = and != except when one or both of the operands are NULL.

tcl/e_expr.test:298

/* IMP: R-24731-45773 */
# EVIDENCE-OF: R-24731-45773 The IS and IS NOT operators work like = and
# != except when one or both of the operands are NULL.

R-06325-15315-47203-37013-07627-21557-12001-05874 tcl slt th3 src

In this case, if both operands are NULL, then the IS operator evaluates to 1 (true) and the IS NOT operator evaluates to 0 (false).

tcl/e_expr.test:301

/* IMP: R-06325-15315 */
# EVIDENCE-OF: R-06325-15315 In this case, if both operands are NULL,
# then the IS operator evaluates to 1 (true) and the IS NOT operator
# evaluates to 0 (false).

R-19812-36779-26037-25587-55568-01966-51571-26935 tcl slt th3 src

If one operand is NULL and the other is not, then the IS operator evaluates to 0 (false) and the IS NOT operator is 1 (true).

tcl/e_expr.test:305

/* IMP: R-19812-36779 */
# EVIDENCE-OF: R-19812-36779 If one operand is NULL and the other is
# not, then the IS operator evaluates to 0 (false) and the IS NOT
# operator is 1 (true).

R-61975-13410-23961-36433-37989-49063-55179-53550 tcl slt th3 src

It is not possible for an IS or IS NOT expression to evaluate to NULL.

tcl/e_expr.test:309

/* IMP: R-61975-13410 */
# EVIDENCE-OF: R-61975-13410 It is not possible for an IS or IS NOT
# expression to evaluate to NULL.

R-40514-61038-17125-46300-24819-55114-07241-40466 tcl slt th3 src

The IS NOT DISTINCT FROM operator is an alternative spelling for the IS operator.

/* IMP: R-40514-61038 */
# EVIDENCE-OF: R-40514-61038 The IS NOT DISTINCT FROM operator is an
# alternative spelling for the IS operator.

R-38890-04494-12007-38862-04785-26769-02730-62637 tcl slt th3 src

Likewise, the IS DISTINCT FROM operator means the same thing as IS NOT.

/* IMP: R-38890-04494 */
# EVIDENCE-OF: R-38890-04494 Likewise, the IS DISTINCT FROM operator
# means the same thing as IS NOT.

R-31536-32008-60945-18932-27030-19997-64437-42960 tcl slt th3 src

Literal values may be integers, floating point numbers, strings, BLOBs, or NULLs.

tcl/e_expr.test:421

/* IMP: R-31536-32008 */
# EVIDENCE-OF: R-31536-32008 Literal values may be integers, floating
# point numbers, strings, BLOBs, or NULLs.

R-13406-45695-21963-27018-56776-23450-25791-30015 tcl slt th3 src

If a numeric literal has a decimal point or an exponentiation clause or if it is less than -9223372036854775808 or greater than 9223372036854775807, then it is a floating point literal. Otherwise is it is an integer literal.

th3/req1/expr01.test:11

/* IMP: R-13406-45695 */
# EVIDENCE-OF: R-13406-45695 If a numeric literal has a decimal point or
# an exponentiation clause or if it is less than -9223372036854775808 or
# greater than 9223372036854775807, then it is a floating point literal.
# Otherwise is it is an integer literal.

R-31163-29022-10663-19494-01661-06524-11639-30452 tcl slt th3 src

The "E" character that begins the exponentiation clause of a floating point literal can be either upper or lower case.

th3/req1/expr01.test:36

/* IMP: R-31163-29022 */
# EVIDENCE-OF: R-31163-29022 The "E" character that begins the
# exponentiation clause of a floating point literal can be either upper
# or lower case.

R-15867-30493-08974-44645-42836-18647-48672-50550 tcl slt th3 src

The "." character is always used as the decimal point even if the locale setting specifies "," for this role - the use of "," for the decimal point would result in syntactic ambiguity.

th3/req1/expr01.test:44

/* IMP: R-15867-30493 */
# EVIDENCE-OF: R-15867-30493 The "." character is always used as the
# decimal point even if the locale setting specifies "," for this role -
# the use of "," for the decimal point would result in syntactic
# ambiguity.

R-50109-18895-48987-07545-37480-53059-10212-16515 tcl slt th3 src

Hexadecimal integer literals follow the C-language notation of "0x" or "0X" followed by hexadecimal digits.

th3/req1/expr01.test:53

/* IMP: R-50109-18895 */
# EVIDENCE-OF: R-50109-18895 Hexadecimal integer literals follow the
# C-language notation of "0x" or "0X" followed by hexadecimal digits.

R-12628-51384-03932-15263-35503-59702-54474-35956 tcl slt th3 src

For example, 0x1234 means the same as 4660 and 0x8000000000000000 means the same as -9223372036854775808.

th3/req1/expr01.test:56

/* IMP: R-12628-51384 */
# EVIDENCE-OF: R-12628-51384 For example, 0x1234 means the same as 4660
# and 0x8000000000000000 means the same as -9223372036854775808.

R-42106-50385-56441-15914-62934-29085-54052-00189 tcl slt th3 src

Hexadecimal integer literals are interpreted as 64-bit two's-complement integers and are thus limited to sixteen significant digits of precision.

th3/req1/expr01.test:67

/* IMP: R-42106-50385 */
# EVIDENCE-OF: R-42106-50385 Hexadecimal integer literals are
# interpreted as 64-bit two's-complement integers and are thus limited
# to sixteen significant digits of precision.

R-21873-57098-57834-11008-20676-08257-29659-57534 tcl slt th3 src

For backwards compatibility, the "0x" hexadecimal integer notation is only understood by the SQL language parser, not by the type conversions routines.

th3/req1/expr01.test:81

/* IMP: R-21873-57098 */
# EVIDENCE-OF: R-21873-57098 For backwards compatibility, the "0x"
# hexadecimal integer notation is only understood by the SQL language
# parser, not by the type conversions routines.

R-47301-17448-04122-36354-45464-07871-26388-12045 tcl slt th3 src

String variables that contain text formatted like hexadecimal integers are not interpreted as hexadecimal integers when coercing the string value into an integer due to a CAST expression or for a column affinity transformation or prior to performing a numeric operation or for any other run-time conversions.

th3/req1/expr01.test:85

/* IMP: R-47301-17448 */
# EVIDENCE-OF: R-47301-17448 String variables that contain text
# formatted like hexadecimal integers are not interpreted as hexadecimal
# integers when coercing the string value into an integer due to a CAST
# expression or for a column affinity transformation or prior to
# performing a numeric operation or for any other run-time conversions.

R-43895-16198-12902-10668-43383-15391-26544-03216 tcl slt th3 src

When coercing a string value in the format of a hexadecimal integer into an integer value, the conversion process stops when the 'x' character is seen so the resulting integer value is always zero.

th3/req1/expr01.test:91

/* IMP: R-43895-16198 */
# EVIDENCE-OF: R-43895-16198 When coercing a string value in the format
# of a hexadecimal integer into an integer value, the conversion process
# stops when the 'x' character is seen so the resulting integer value is
# always zero.

R-05658-50861-03980-59142-22738-32773-09138-30302 tcl slt th3 src

SQLite only understands the hexadecimal integer notation when it appears in the SQL statement text, not when it appears as part of the content of the database.

th3/req1/expr01.test:96

/* IMP: R-05658-50861 */
# EVIDENCE-OF: R-05658-50861 SQLite only understands the hexadecimal
# integer notation when it appears in the SQL statement text, not when
# it appears as part of the content of the database.

R-35229-17830-32159-37744-59002-46141-27438-26089 tcl slt th3 src

A string constant is formed by enclosing the string in single quotes (').

tcl/e_expr.test:437

/* IMP: R-35229-17830 */
# EVIDENCE-OF: R-35229-17830 A string constant is formed by enclosing
# the string in single quotes (').

R-07100-06606-15404-00202-26903-38022-07639-13720 tcl slt th3 src

A single quote within the string can be encoded by putting two single quotes in a row - as in Pascal.

tcl/e_expr.test:440

/* IMP: R-07100-06606 */
# EVIDENCE-OF: R-07100-06606 A single quote within the string can be
# encoded by putting two single quotes in a row - as in Pascal.

R-09593-03321-24060-42412-44512-07305-25128-61318 tcl slt th3 src

BLOB literals are string literals containing hexadecimal data and preceded by a single "x" or "X" character.

tcl/e_expr.test:448

/* IMP: R-09593-03321 */
# EVIDENCE-OF: R-09593-03321 BLOB literals are string literals
# containing hexadecimal data and preceded by a single "x" or "X"
# character.

R-19836-11244-52903-63249-46309-23850-25183-00208 tcl slt th3 src

Example: X'53514C697465'

tcl/e_expr.test:452

/* IMP: R-19836-11244 */
# EVIDENCE-OF: R-19836-11244 Example: X'53514C697465'

R-23914-51476-03843-05689-25158-40099-03729-02958 tcl slt th3 src

A literal value can also be the token "NULL".

tcl/e_expr.test:460

/* IMP: R-23914-51476 */
# EVIDENCE-OF: R-23914-51476 A literal value can also be the token
# "NULL".

R-33509-39458-36310-35502-14516-21374-43920-49454 tcl slt th3 src

A question mark followed by a number NNN holds a spot for the NNN-th parameter. NNN must be between 1 and SQLITE_MAX_VARIABLE_NUMBER.

tcl/e_expr.test:491

/* IMP: R-33509-39458 */
# EVIDENCE-OF: R-33509-39458 A question mark followed by a number NNN
# holds a spot for the NNN-th parameter. NNN must be between 1 and
# SQLITE_MAX_VARIABLE_NUMBER.

R-33670-36097-38044-00457-34720-22769-46022-27724 tcl slt th3 src

A question mark that is not followed by a number creates a parameter with a number one greater than the largest parameter number already assigned.

tcl/e_expr.test:518

/* IMP: R-33670-36097 */
# EVIDENCE-OF: R-33670-36097 A question mark that is not followed by a
# number creates a parameter with a number one greater than the largest
# parameter number already assigned.

R-42938-07030-34028-51732-04227-55156-04511-38808 tcl slt th3 src

If this means the parameter number is greater than SQLITE_MAX_VARIABLE_NUMBER, it is an error.

tcl/e_expr.test:522

/* IMP: R-42938-07030 */
# EVIDENCE-OF: R-42938-07030 If this means the parameter number is
# greater than SQLITE_MAX_VARIABLE_NUMBER, it is an error.

R-11620-22743-59737-64939-21707-40674-29550-48097 tcl slt th3 src

A colon followed by an identifier name holds a spot for a named parameter with the name :AAAA.

tcl/e_expr.test:543

/* IMP: R-11620-22743 */
# EVIDENCE-OF: R-11620-22743 A colon followed by an identifier name
# holds a spot for a named parameter with the name :AAAA.

R-11370-04520-26477-32393-15829-52644-05616-39032 tcl slt th3 src

Named parameters are also numbered. The number assigned is one greater than the largest parameter number already assigned.

tcl/e_expr.test:595

/* IMP: R-11370-04520 */
# EVIDENCE-OF: R-11370-04520 Named parameters are also numbered. The
# number assigned is one greater than the largest parameter number
# already assigned.

R-42620-22184-27875-60566-02937-27650-15183-08626 tcl slt th3 src

If this means the parameter would be assigned a number greater than SQLITE_MAX_VARIABLE_NUMBER, it is an error.

tcl/e_expr.test:599

/* IMP: R-42620-22184 */
# EVIDENCE-OF: R-42620-22184 If this means the parameter would be
# assigned a number greater than SQLITE_MAX_VARIABLE_NUMBER, it is an
# error.

R-49783-61279-16242-54630-23858-13201-42746-50539 tcl slt th3 src

An "at" sign works exactly like a colon, except that the name of the parameter created is @AAAA.

tcl/e_expr.test:559

/* IMP: R-49783-61279 */
# EVIDENCE-OF: R-49783-61279 An "at" sign works exactly like a colon,
# except that the name of the parameter created is @AAAA.

R-62610-51329-57761-33466-25437-21860-03475-27712 tcl slt th3 src

A dollar-sign followed by an identifier name also holds a spot for a named parameter with the name $AAAA.

tcl/e_expr.test:571

/* IMP: R-62610-51329 */
# EVIDENCE-OF: R-62610-51329 A dollar-sign followed by an identifier
# name also holds a spot for a named parameter with the name $AAAA.

R-55025-21042-57260-24001-55816-18376-64535-50045 tcl slt th3 src

The identifier name in this case can include one or more occurrences of "::" and a suffix enclosed in "(...)" containing any text at all.

tcl/e_expr.test:574

/* IMP: R-55025-21042 */
# EVIDENCE-OF: R-55025-21042 The identifier name in this case can
# include one or more occurrences of "::" and a suffix enclosed in
# "(...)" containing any text at all.

R-14068-49671-08903-14280-45288-40590-58798-59213 tcl slt th3 src

Parameters that are not assigned values using sqlite3_bind() are treated as NULL.

tcl/e_expr.test:616

/* IMP: R-14068-49671 */
# EVIDENCE-OF: R-14068-49671 Parameters that are not assigned values
# using sqlite3_bind() are treated as NULL.

R-38091-32352-01038-12567-23855-46288-57631-62410 tcl slt th3 src

The maximum parameter number is set at compile-time by the SQLITE_MAX_VARIABLE_NUMBER macro.

src/main.c:2800

/* IMP: R-38091-32352 */
# EVIDENCE-OF: R-38091-32352 The maximum parameter number is set at
# compile-time by the SQLITE_MAX_VARIABLE_NUMBER macro.

R-47512-27714-00574-29870-48560-40440-32292-60340 tcl slt th3 src

An individual database connection D can reduce its maximum parameter number below the compile-time maximum using the sqlite3_limit(D, SQLITE_LIMIT_VARIABLE_NUMBER,...) interface.

th3/req1/bind01.test:129

/* IMP: R-47512-27714 */
# EVIDENCE-OF: R-47512-27714 An individual database connection D can
# reduce its maximum parameter number below the compile-time maximum
# using the sqlite3_limit(D, SQLITE_LIMIT_VARIABLE_NUMBER,...)
# interface.

R-16584-60189-60940-01835-35282-37415-55139-16536 tcl slt th3 src

The LIKE operator does a pattern matching comparison.

tcl/e_expr.test:905

/* IMP: R-16584-60189 */
# EVIDENCE-OF: R-16584-60189 The LIKE operator does a pattern matching
# comparison.

R-11295-04657-09653-04480-53801-04231-56338-07604 tcl slt th3 src

The operand to the right of the LIKE operator contains the pattern and the left hand operand contains the string to match against the pattern.

tcl/e_expr.test:908

/* IMP: R-11295-04657 */
# EVIDENCE-OF: R-11295-04657 The operand to the right of the LIKE
# operator contains the pattern and the left hand operand contains the
# string to match against the pattern.

R-55406-38524-31149-09087-45874-46813-10331-17259 tcl slt th3 src

A percent symbol ("%") in the LIKE pattern matches any sequence of zero or more characters in the string.

tcl/e_expr.test:915

/* IMP: R-55406-38524 */
# EVIDENCE-OF: R-55406-38524 A percent symbol ("%") in the LIKE pattern
# matches any sequence of zero or more characters in the string.

R-30433-25443-23879-51033-37593-48703-34224-12115 tcl slt th3 src

An underscore ("_") in the LIKE pattern matches any single character in the string.

tcl/e_expr.test:922

/* IMP: R-30433-25443 */
# EVIDENCE-OF: R-30433-25443 An underscore ("_") in the LIKE pattern
# matches any single character in the string.

R-59007-20454-04815-57542-48714-11187-47465-31544 tcl slt th3 src

Any other character matches itself or its lower/upper case equivalent (i.e. case-insensitive matching).

tcl/e_expr.test:929

/* IMP: R-59007-20454 */
# EVIDENCE-OF: R-59007-20454 Any other character matches itself or its
# lower/upper case equivalent (i.e. case-insensitive matching).

R-23648-58527-04335-61943-03061-32754-63941-35147 tcl slt th3 src

SQLite only understands upper/lower case for ASCII characters by default.

tcl/e_expr.test:936

/* IMP: R-23648-58527 */
# EVIDENCE-OF: R-23648-58527 SQLite only understands upper/lower case
# for ASCII characters by default.

R-04532-11527-60293-16788-37808-59040-51319-08926 tcl slt th3 src

The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range.

tcl/e_expr.test:939

/* IMP: R-04532-11527 */
# EVIDENCE-OF: R-04532-11527 The LIKE operator is case sensitive by
# default for unicode characters that are beyond the ASCII range.

R-44381-11669-25586-00441-33187-20695-56764-33989 tcl slt th3 src

the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.

tcl/e_expr.test:942

/* IMP: R-44381-11669 */
# EVIDENCE-OF: R-44381-11669 the expression
# 'a'&nbsp;LIKE&nbsp;'A' is TRUE but
# '&aelig;'&nbsp;LIKE&nbsp;'&AElig;' is FALSE.

R-56683-13731-54307-64156-42285-19581-37676-29217 tcl slt th3 src

If the optional ESCAPE clause is present, then the expression following the ESCAPE keyword must evaluate to a string consisting of a single character.

tcl/e_expr.test:955

/* IMP: R-56683-13731 */
# EVIDENCE-OF: R-56683-13731 If the optional ESCAPE clause is present,
# then the expression following the ESCAPE keyword must evaluate to a
# string consisting of a single character.

R-02045-23762-08268-15190-44661-50351-03152-06188 tcl slt th3 src

This character may be used in the LIKE pattern to include literal percent or underscore characters.

tcl/e_expr.test:968

/* IMP: R-02045-23762 */
# EVIDENCE-OF: R-02045-23762 This character may be used in the LIKE
# pattern to include literal percent or underscore characters.

R-13345-31830-42625-35192-25815-10226-10074-63536 tcl slt th3 src

The escape character followed by a percent symbol (%), underscore (_), or a second instance of the escape character itself matches a literal percent symbol, underscore, or a single escape character, respectively.

tcl/e_expr.test:971

/* IMP: R-13345-31830 */
# EVIDENCE-OF: R-13345-31830 The escape character followed by a percent
# symbol (%), underscore (_), or a second instance of the escape
# character itself matches a literal percent symbol, underscore, or a
# single escape character, respectively.

R-51359-17496-64791-11531-01433-14001-31199-61206 tcl slt th3 src

The infix LIKE operator is implemented by calling the application-defined SQL functions like(Y,X) or like(Y,X,Z).

tcl/e_expr.test:993

/* IMP: R-51359-17496 */
# EVIDENCE-OF: R-51359-17496 The infix LIKE operator is implemented by
# calling the application-defined SQL functions like(Y,X) or
# like(Y,X,Z).

R-22868-25880-64801-36236-02118-32586-25357-26503 tcl slt th3 src

The LIKE operator can be made case sensitive using the case_sensitive_like pragma.

tcl/e_expr.test:1011

/* IMP: R-22868-25880 */
# EVIDENCE-OF: R-22868-25880 The LIKE operator can be made case
# sensitive using the case_sensitive_like pragma.

R-52087-12043-18539-27674-65294-02537-52169-03316 tcl slt th3 src

The GLOB operator is similar to LIKE but uses the Unix file globbing syntax for its wildcards.

tcl/e_expr.test:1027

/* IMP: R-52087-12043 */
# EVIDENCE-OF: R-52087-12043 The GLOB operator is similar to LIKE but
# uses the Unix file globbing syntax for its wildcards.

R-09813-17279-59166-04895-48075-17845-31813-35638 tcl slt th3 src

Also, GLOB is case sensitive, unlike LIKE.

tcl/e_expr.test:1030

/* IMP: R-09813-17279 */
# EVIDENCE-OF: R-09813-17279 Also, GLOB is case sensitive, unlike LIKE.

R-39616-20555-02533-15918-45822-50476-08959-13235 tcl slt th3 src

Both GLOB and LIKE may be preceded by the NOT keyword to invert the sense of the test.

tcl/e_expr.test:1041

/* IMP: R-39616-20555 */
# EVIDENCE-OF: R-39616-20555 Both GLOB and LIKE may be preceded by the
# NOT keyword to invert the sense of the test.

R-39414-35489-25303-10592-22636-36530-45454-18784 tcl slt th3 src

The infix GLOB operator is implemented by calling the function glob(Y,X) and can be modified by overriding that function.

tcl/e_expr.test:1057

/* IMP: R-39414-35489 */
# EVIDENCE-OF: R-39414-35489 The infix GLOB operator is implemented by
# calling the function glob(Y,X) and can be modified by overriding that
# function.

R-33693-50180-37638-14993-01835-21324-19267-11438 tcl slt th3 src

The REGEXP operator is a special syntax for the regexp() user function.

tcl/e_expr.test:1088

/* IMP: R-33693-50180 */
# EVIDENCE-OF: R-33693-50180 The REGEXP operator is a special syntax for
# the regexp() user function.

R-41650-20872-58221-16141-48271-22021-38019-62849 tcl slt th3 src

No regexp() user function is defined by default and so use of the REGEXP operator will normally result in an error message.

tcl/e_expr.test:1073

/* IMP: R-41650-20872 */
# EVIDENCE-OF: R-41650-20872 No regexp() user function is defined by
# default and so use of the REGEXP operator will normally result in an
# error message.

R-65524-61849-43329-61953-54493-09890-31645-08912 tcl slt th3 src

If an application-defined SQL function named "regexp" is added at run-time, then the "X REGEXP Y" operator will be implemented as a call to "regexp(Y,X)".

tcl/e_expr.test:1091

/* IMP: R-65524-61849 */
# EVIDENCE-OF: R-65524-61849 If an application-defined SQL function
# named "regexp" is added at run-time, then the "X REGEXP Y" operator
# will be implemented as a call to "regexp(Y,X)".

R-37916-47407-25841-44869-57866-03917-48046-05809 tcl slt th3 src

The MATCH operator is a special syntax for the match() application-defined function.

tcl/e_expr.test:1118

/* IMP: R-37916-47407 */
# EVIDENCE-OF: R-37916-47407 The MATCH operator is a special syntax for
# the match() application-defined function.

R-42037-37826-09680-08362-57128-46753-57920-34709 tcl slt th3 src

The default match() function implementation raises an exception and is not really useful for anything.

tcl/e_expr.test:1108

/* IMP: R-42037-37826 */
# EVIDENCE-OF: R-42037-37826 The default match() function implementation
# raises an exception and is not really useful for anything.

R-06021-09373-60954-10709-09959-52253-36320-11394 tcl slt th3 src

But extensions can override the match() function with more helpful logic.

tcl/e_expr.test:1121

/* IMP: R-06021-09373 */
# EVIDENCE-OF: R-06021-09373 But extensions can override the match()
# function with more helpful logic.

R-17939-16412-24446-20634-14473-37434-37604-14341 tcl slt th3 src

The extract operators act as a special syntax for functions "->"() and "->>"().

/* IMP: R-17939-16412 */
# EVIDENCE-OF: R-17939-16412 The extract operators act as a special
# syntax for functions "->"() and "->>"().

R-52226-38079-47944-26138-22485-09785-27030-51163 tcl slt th3 src

Default implementations for these functions perform JSON subcomponent extraction, but extensions can override them for other purposes.

/* IMP: R-52226-38079 */
# EVIDENCE-OF: R-52226-38079 Default implementations for these functions
# perform JSON subcomponent extraction, but extensions can override them
# for other purposes.

R-40079-54503-52433-22063-65278-03713-13772-01502 tcl slt th3 src

The BETWEEN operator is logically equivalent to a pair of comparisons. "x BETWEEN y AND z" is equivalent to "x>=y AND x<=z" except that with BETWEEN, the x expression is only evaluated once.

tcl/e_expr.test:836   th3/cov1/rowvalue04.test:17

/* IMP: R-40079-54503 */
# EVIDENCE-OF: R-40079-54503 The BETWEEN operator is logically
# equivalent to a pair of comparisons. "x BETWEEN y AND z" is equivalent
# to "x>=y AND x<=z" except that with BETWEEN, the x expression is
# only evaluated once.

R-57495-24088-42518-44895-31255-64313-21113-39817 tcl slt th3 src

There are two fundamental forms of the CASE expression: those with a base expression and those without.

tcl/e_expr.test:1140

/* IMP: R-57495-24088 */
# EVIDENCE-OF: R-57495-24088 There are two fundamental forms of the CASE
# expression: those with a base expression and those without.

R-30638-59954-59281-20323-32142-07020-22821-14638 tcl slt th3 src

In a CASE without a base expression, each WHEN expression is evaluated and the result treated as a boolean, starting with the leftmost and continuing to the right.

tcl/e_expr.test:1156

/* IMP: R-30638-59954 */
# EVIDENCE-OF: R-30638-59954 In a CASE without a base expression, each
# WHEN expression is evaluated and the result treated as a boolean,
# starting with the leftmost and continuing to the right.

R-39009-25596-33829-41361-38484-11658-48369-57903 tcl slt th3 src

The result of the CASE expression is the evaluation of the THEN expression that corresponds to the first WHEN expression that evaluates to true.

tcl/e_expr.test:1178

/* IMP: R-39009-25596 */
# EVIDENCE-OF: R-39009-25596 The result of the CASE expression is the
# evaluation of the THEN expression that corresponds to the first WHEN
# expression that evaluates to true.

R-24227-04807-65013-09510-28047-53461-17252-27305 tcl slt th3 src

Or, if none of the WHEN expressions evaluate to true, the result of evaluating the ELSE expression, if any.

tcl/e_expr.test:1207

/* IMP: R-24227-04807 */
# EVIDENCE-OF: R-24227-04807 Or, if none of the WHEN expressions
# evaluate to true, the result of evaluating the ELSE expression, if
# any.

R-14168-07579-40145-07578-27946-11279-56601-46509 tcl slt th3 src

If there is no ELSE expression and none of the WHEN expressions are true, then the overall result is NULL.

tcl/e_expr.test:1220

/* IMP: R-14168-07579 */
# EVIDENCE-OF: R-14168-07579 If there is no ELSE expression and none of
# the WHEN expressions are true, then the overall result is NULL.

R-13943-13592-05756-02149-18071-59821-47409-19193 tcl slt th3 src

A NULL result is considered untrue when evaluating WHEN terms.

tcl/e_expr.test:1232

/* IMP: R-13943-13592 */
# EVIDENCE-OF: R-13943-13592 A NULL result is considered untrue when
# evaluating WHEN terms.

R-38620-19499-44951-35069-39820-53253-57753-11041 tcl slt th3 src

In a CASE with a base expression, the base expression is evaluated just once and the result is compared against the evaluation of each WHEN expression from left to right.

tcl/e_expr.test:1242

/* IMP: R-38620-19499 */
# EVIDENCE-OF: R-38620-19499 In a CASE with a base expression, the base
# expression is evaluated just once and the result is compared against
# the evaluation of each WHEN expression from left to right.

R-07667-49537-57124-54989-59227-41131-33160-03537 tcl slt th3 src

The result of the CASE expression is the evaluation of the THEN expression that corresponds to the first WHEN expression for which the comparison is true.

tcl/e_expr.test:1257

/* IMP: R-07667-49537 */
# EVIDENCE-OF: R-07667-49537 The result of the CASE expression is the
# evaluation of the THEN expression that corresponds to the first WHEN
# expression for which the comparison is true.

R-47543-32145-59149-48631-62108-17148-32947-37500 tcl slt th3 src

Or, if none of the WHEN expressions evaluate to a value equal to the base expression, the result of evaluating the ELSE expression, if any.

tcl/e_expr.test:1268

/* IMP: R-47543-32145 */
# EVIDENCE-OF: R-47543-32145 Or, if none of the WHEN expressions
# evaluate to a value equal to the base expression, the result of
# evaluating the ELSE expression, if any.

R-54721-48557-63407-03546-07641-33336-53635-34168 tcl slt th3 src

If there is no ELSE expression and none of the WHEN expressions produce a result equal to the base expression, the overall result is NULL.

tcl/e_expr.test:1276

/* IMP: R-54721-48557 */
# EVIDENCE-OF: R-54721-48557 If there is no ELSE expression and none of
# the WHEN expressions produce a result equal to the base expression,
# the overall result is NULL.

R-11479-62774-14648-38644-49524-53539-14021-51295 tcl slt th3 src

When comparing a base expression against a WHEN expression, the same collating sequence, affinity, and NULL-handling rules apply as if the base expression and WHEN expression are respectively the left- and right-hand operands of an = operator.

tcl/e_expr.test:1289

/* IMP: R-11479-62774 */
# EVIDENCE-OF: R-11479-62774 When comparing a base expression against a
# WHEN expression, the same collating sequence, affinity, and
# NULL-handling rules apply as if the base expression and WHEN
# expression are respectively the left- and right-hand operands of an =
# operator.

R-37304-39405-25413-14317-50314-46541-26352-18136 tcl slt th3 src

If the base expression is NULL then the result of the CASE is always the result of evaluating the ELSE expression if it exists, or NULL if it does not.

tcl/e_expr.test:1341

/* IMP: R-37304-39405 */
# EVIDENCE-OF: R-37304-39405 If the base expression is NULL then the
# result of the CASE is always the result of evaluating the ELSE
# expression if it exists, or NULL if it does not.

R-56280-17369-11717-14525-09241-09664-14556-20621 tcl slt th3 src

Both forms of the CASE expression use lazy, or short-circuit, evaluation.

tcl/e_expr.test:1352

/* IMP: R-56280-17369 */
# EVIDENCE-OF: R-56280-17369 Both forms of the CASE expression use lazy,
# or short-circuit, evaluation.

R-34773-62253-14389-56183-06695-27653-47306-47953 tcl slt th3 src

The only difference between the following two CASE expressions is that the x expression is evaluated exactly once in the first example but might be evaluated multiple times in the second:

tcl/e_expr.test:1373

/* IMP: R-34773-62253 */
# EVIDENCE-OF: R-34773-62253 The only difference between the following
# two CASE expressions is that the x expression is evaluated exactly
# once in the first example but might be evaluated multiple times in the
# second: CASE x WHEN w1 THEN r1 WHEN w2 THEN r2 ELSE r3 END CASE WHEN
# x=w1 THEN r1 WHEN x=w2 THEN r2 ELSE r3 END

R-04465-11976-19179-54741-15399-04029-28816-38507 tcl slt th3 src

The built-in iif(x,y,z) SQL function is logically equivalent to "CASE WHEN x THEN y ELSE z END".

/* IMP: R-04465-11976 */
# EVIDENCE-OF: R-04465-11976 The built-in iif(x,y,z) SQL function is
# logically equivalent to "CASE WHEN x THEN y ELSE z END".

R-15810-56691-30500-50989-63977-00699-03712-43349 tcl slt th3 src

The IN and NOT IN operators take an expression on the left and a list of values or a subquery on the right.

th3/cov1/in01.test:10

/* IMP: R-15810-56691 */
# EVIDENCE-OF: R-15810-56691 The IN and NOT IN operators take an
# expression on the left and a list of values or a subquery on the
# right.

R-01921-64245-04718-64212-38644-45300-05525-61121 tcl slt th3 src

When the right operand of an IN or NOT IN operator is a subquery, the subquery must have the same number of columns as there are columns in the row value of the left operand.

th3/cov1/rowvalue06.test:55

/* IMP: R-01921-64245 */
# EVIDENCE-OF: R-01921-64245 When the right operand of an IN or NOT IN
# operator is a subquery, the subquery must have the same number of
# columns as there are columns in the row value of the left operand.

R-35033-20570-55146-33091-43588-36289-00669-04528 tcl slt th3 src

The subquery on the right of an IN or NOT IN operator must be a scalar subquery if the left expression is not a row value expression.

slt/in2.test:292

/* IMP: R-35033-20570 */
# EVIDENCE-OF: R-35033-20570 The subquery on the right of an IN or NOT
# IN operator must be a scalar subquery if the left expression is not a
# row value expression.

R-05985-29284-11131-56196-04541-34001-38610-39560 tcl slt th3 src

If the right operand of an IN or NOT IN operator is a list of values, each of those values must be scalars and the left expression must also be a scalar.

th3/cov1/rowvalue06.test:84

/* IMP: R-05985-29284 */
# EVIDENCE-OF: R-05985-29284 If the right operand of an IN or NOT IN
# operator is a list of values, each of those values must be scalars and
# the left expression must also be a scalar.

R-29609-10377-53436-28646-00070-22457-04173-55911 tcl slt th3 src

The right-hand side of an IN or NOT IN operator can be a table name or table-valued function name in which case the right-hand side is understood to be subquery of the form "(SELECT * FROM name)".

th3/cov1/in01.test:176

/* IMP: R-29609-10377 */
# EVIDENCE-OF: R-29609-10377 The right-hand side of an IN or NOT IN
# operator can be a table name or table-valued function name in which
# case the right-hand side is understood to be subquery of the form
# "(SELECT * FROM name)".

R-52275-55503-36173-27620-56866-61017-01277-04274 tcl slt th3 src

When the right operand is an empty set, the result of IN is false and the result of NOT IN is true, regardless of the left operand and even if the left operand is NULL.

slt/in1.test:11   slt/in2.test:2   tcl/tkt-80e031a00f.test:23

/* IMP: R-52275-55503 */
# EVIDENCE-OF: R-52275-55503 When the right operand is an empty set, the
# result of IN is false and the result of NOT IN is true, regardless of
# the left operand and even if the left operand is NULL.

R-50221-42915-63366-22900-20330-11785-03020-07712 tcl slt th3 src

The result of an IN or NOT IN operator is determined by the following matrix:

Left operand
is NULL
Right operand
contains NULL
Right operand
is an empty set
Left operand found
within right operand
Result of
IN operator
Result of
NOT IN operator
no no no no false true
does not matter no yes no false true
no does not matter no yes true false
no yes no no NULL NULL
yes does not matter no does not matter NULL NULL

slt/in1.test:329   slt/in2.test:14   tcl/tkt-80e031a00f.test:78

/* IMP: R-50221-42915 */
# EVIDENCE-OF: R-50221-42915 The result of an IN or NOT IN operator is
# determined by the following matrix: Left operand is NULL Right operand
# contains NULL Right operand is an empty set Left operand found within
# right operand Result of IN operator Result of NOT IN operator no no no
# no false true does not matter no yes no false true no does not matter
# no yes true false no yes no no NULL NULL yes does not matter no does
# not matter NULL NULL

R-64309-54027-59043-55394-44740-32363-09353-52074 tcl slt th3 src

Note that SQLite allows the parenthesized list of scalar values on the right-hand side of an IN or NOT IN operator to be an empty list but most other SQL database engines and the SQL92 standard require the list to contain at least one element.

slt/in1.test:16   slt/in2.test:7   tcl/tkt-80e031a00f.test:27

/* IMP: R-64309-54027 */
# EVIDENCE-OF: R-64309-54027 Note that SQLite allows the parenthesized
# list of scalar values on the right-hand side of an IN or NOT IN
# operator to be an empty list but most other SQL database engines and
# the SQL92 standard require the list to contain at least one element.

R-06726-07466-50674-60893-18596-18216-57915-63107 tcl slt th3 src

A column name can be any of the names defined in the CREATE TABLE statement or one of the following special identifiers: "ROWID", "OID", or "_ROWID_".

tcl/e_createtable.test:1676

/* IMP: R-06726-07466 */
# EVIDENCE-OF: R-06726-07466 A column name can be any of the names
# defined in the CREATE TABLE statement or one of the following special
# identifiers: "ROWID", "OID", or "_ROWID_".

R-07387-29430-25270-46585-59144-29340-25578-53451 tcl slt th3 src

The three special identifiers describe the unique integer key (the rowid) associated with every row of every table and so are not available on WITHOUT ROWID tables.

th3/req1/expr02.test:33

/* IMP: R-07387-29430 */
# EVIDENCE-OF: R-07387-29430 The three special identifiers describe the
# unique integer key (the rowid) associated with every row of every
# table and so are not available on WITHOUT ROWID tables.

R-44615-33286-13182-19247-40132-09732-39940-41262 tcl slt th3 src

The special identifiers only refer to the row key if the CREATE TABLE statement does not define a real column with the same name.

tcl/e_createtable.test:1704

/* IMP: R-44615-33286 */
# EVIDENCE-OF: R-44615-33286 The special identifiers only refer to the
# row key if the CREATE TABLE statement does not define a real column
# with the same name.

R-46129-45598-36416-42008-62999-11143-15168-02813 tcl slt th3 src

The rowid can be used anywhere a regular column can be used.

/* IMP: R-46129-45598 */
# EVIDENCE-OF: R-46129-45598 The rowid can be used anywhere a regular
# column can be used.

R-25588-27181-18097-02154-44633-08776-21987-21638 tcl slt th3 src

The EXISTS operator always evaluates to one of the integer values 0 and 1.

tcl/e_expr.test:1794

/* IMP: R-25588-27181 */
# EVIDENCE-OF: R-25588-27181 The EXISTS operator always evaluates to one
# of the integer values 0 and 1.

R-58553-63740-12454-47627-42438-52862-15434-40396 tcl slt th3 src

If executing the SELECT statement specified as the right-hand operand of the EXISTS operator would return one or more rows, then the EXISTS operator evaluates to 1.

tcl/e_expr.test:1802

/* IMP: R-58553-63740 */
# EVIDENCE-OF: R-58553-63740 If executing the SELECT statement specified
# as the right-hand operand of the EXISTS operator would return one or
# more rows, then the EXISTS operator evaluates to 1.

R-19673-40972-58319-61162-14300-46572-05681-35590 tcl slt th3 src

If executing the SELECT would return no rows at all, then the EXISTS operator evaluates to 0.

tcl/e_expr.test:1816

/* IMP: R-19673-40972 */
# EVIDENCE-OF: R-19673-40972 If executing the SELECT would return no
# rows at all, then the EXISTS operator evaluates to 0.

R-35109-49139-58862-12127-06342-61829-38093-58472 tcl slt th3 src

The number of columns in each row returned by the SELECT statement (if any) and the specific values returned have no effect on the results of the EXISTS operator.

tcl/e_expr.test:1828

/* IMP: R-35109-49139 */
# EVIDENCE-OF: R-35109-49139 The number of columns in each row returned
# by the SELECT statement (if any) and the specific values returned have
# no effect on the results of the EXISTS operator.

R-10645-12439-29307-46302-11314-15082-25631-53469 tcl slt th3 src

In particular, rows containing NULL values are not handled any differently from rows without NULL values.

tcl/e_expr.test:1847

/* IMP: R-10645-12439 */
# EVIDENCE-OF: R-10645-12439 In particular, rows containing NULL values
# are not handled any differently from rows without NULL values.

R-43573-23448-48051-43416-34138-28993-49586-17736 tcl slt th3 src

A SELECT statement enclosed in parentheses is a subquery.

tcl/e_expr.test:1875

/* IMP: R-43573-23448 */
# EVIDENCE-OF: R-43573-23448 A SELECT statement enclosed in parentheses
# is a subquery.

R-56294-03966-08864-53339-51473-44924-63281-58418 tcl slt th3 src

All types of SELECT statement, including aggregate and compound SELECT queries (queries with keywords like UNION or EXCEPT) are allowed as scalar subqueries.

tcl/e_expr.test:1878

/* IMP: R-56294-03966 */
# EVIDENCE-OF: R-56294-03966 All types of SELECT statement, including
# aggregate and compound SELECT queries (queries with keywords like
# UNION or EXCEPT) are allowed as scalar subqueries.

R-18318-14995-07554-10565-41972-64784-37540-10382 tcl slt th3 src

The value of a subquery expression is the first row of the result from the enclosed SELECT statement.

tcl/e_expr.test:1915

/* IMP: R-18318-14995 */
# EVIDENCE-OF: R-18318-14995 The value of a subquery expression is the
# first row of the result from the enclosed SELECT statement.

R-52325-25449-60499-51336-30088-24450-41754-02274 tcl slt th3 src

The value of a subquery expression is NULL if the enclosed SELECT statement returns no rows.

tcl/e_expr.test:1940

/* IMP: R-52325-25449 */
# EVIDENCE-OF: R-52325-25449 The value of a subquery expression is NULL
# if the enclosed SELECT statement returns no rows.

R-43101-20178-59872-19302-24143-64185-39096-12597 tcl slt th3 src

A subquery that returns two or more columns is a row value subquery and can only be used as an operand of a comparison operator or as the value in an UPDATE SET clause whose column name list has the same size.

tcl/e_expr.test:1895

/* IMP: R-43101-20178 */
# EVIDENCE-OF: R-43101-20178 A subquery that returns two or more columns
# is a row value subquery and can only be used as an operand of a
# comparison operator or as the value in an UPDATE SET clause whose
# column name list has the same size.

R-25616-08788-18594-15704-08007-00569-12211-26573 tcl slt th3 src

A SELECT statement used as either a scalar subquery or as the right-hand operand of an IN, NOT IN or EXISTS expression may contain references to columns in the outer query.

th3/req1/select01.test:43

/* IMP: R-25616-08788 */
# EVIDENCE-OF: R-25616-08788 A SELECT statement used as either a scalar
# subquery or as the right-hand operand of an IN, NOT IN or EXISTS
# expression may contain references to columns in the outer query.

R-45820-61953-03602-28420-59065-19791-09856-58583 tcl slt th3 src

A correlated subquery is reevaluated each time its result is required.

th3/req1/select01.test:18

/* IMP: R-45820-61953 */
# EVIDENCE-OF: R-45820-61953 A correlated subquery is reevaluated each
# time its result is required.

R-35325-25517-01545-24178-13996-21143-53189-45296 tcl slt th3 src

An uncorrelated subquery is evaluated only once and the result reused as necessary.

th3/req1/select01.test:33

/* IMP: R-35325-25517 */
# EVIDENCE-OF: R-35325-25517 An uncorrelated subquery is evaluated only
# once and the result reused as necessary.

R-20854-17109-31337-20710-58230-10583-22919-16758 tcl slt th3 src

A CAST conversion is similar to the conversion that takes place when a column affinity is applied to a value except that with the CAST operator the conversion always takes place even if the conversion lossy and irreversible, whereas column affinity only changes the data type of a value if the change is lossless and reversible.

tcl/e_expr.test:1417

/* IMP: R-20854-17109 */
# EVIDENCE-OF: R-20854-17109 A CAST conversion is similar to the
# conversion that takes place when a column affinity is applied to a
# value except that with the CAST operator the conversion always takes
# place even if the conversion lossy and irreversible, whereas column
# affinity only changes the data type of a value if the change is
# lossless and reversible.

R-32434-09092-13813-42395-15886-36394-05508-61902 tcl slt th3 src

If the value of expr is NULL, then the result of the CAST expression is also NULL.

tcl/e_expr.test:1436   th3/cov1/cast01.test:12

/* IMP: R-32434-09092 */
# EVIDENCE-OF: R-32434-09092 If the value of expr is NULL, then the
# result of the CAST expression is also NULL.

R-29283-15561-34387-21673-60506-52883-35719-11898 tcl slt th3 src

Otherwise, the storage class of the result is determined by applying the rules for determining column affinity to the type-name.

tcl/e_expr.test:1444

/* IMP: R-29283-15561 */
# EVIDENCE-OF: R-29283-15561 Otherwise, the storage class of the result
# is determined by applying the rules for determining column affinity to
# the type-name.

R-43522-35548-12073-03111-59330-30466-17240-55087 tcl slt th3 src

Casting a value to a type-name with no affinity causes the value to be converted into a BLOB.

tcl/e_expr.test:1451

/* IMP: R-43522-35548 */
# EVIDENCE-OF: R-43522-35548 Casting a value to a type-name with no
# affinity causes the value to be converted into a BLOB.

R-22956-37754-14278-17642-05627-50863-58555-30245 tcl slt th3 src

Casting to a BLOB consists of first casting the value to TEXT in the encoding of the database connection, then interpreting the resulting byte sequence as a BLOB instead of as TEXT.

tcl/e_expr.test:1458

/* IMP: R-22956-37754 */
# EVIDENCE-OF: R-22956-37754 Casting to a BLOB consists of first casting
# the value to TEXT in the encoding of the database connection, then
# interpreting the resulting byte sequence as a BLOB instead of as TEXT.

R-04207-37981-22726-45777-39517-24105-18228-28404 tcl slt th3 src

To cast a BLOB value to TEXT, the sequence of bytes that make up the BLOB is interpreted as text encoded using the database encoding.

tcl/e_expr.test:1484

/* IMP: R-04207-37981 */
# EVIDENCE-OF: R-04207-37981 To cast a BLOB value to TEXT, the sequence
# of bytes that make up the BLOB is interpreted as text encoded using
# the database encoding.

R-22235-47006-02687-15500-56774-48140-19704-63768 tcl slt th3 src

Casting an INTEGER or REAL value into TEXT renders the value as if via sqlite3_snprintf() except that the resulting TEXT uses the encoding of the database connection.

tcl/e_expr.test:1500

/* IMP: R-22235-47006 */
# EVIDENCE-OF: R-22235-47006 Casting an INTEGER or REAL value into TEXT
# renders the value as if via sqlite3_snprintf() except that the
# resulting TEXT uses the encoding of the database connection.

R-26346-36443-14203-01237-59463-02061-43306-07214 tcl slt th3 src

When casting a BLOB value to a REAL, the value is first converted to TEXT.

tcl/e_expr.test:1513

/* IMP: R-26346-36443 */
# EVIDENCE-OF: R-26346-36443 When casting a BLOB value to a REAL, the
# value is first converted to TEXT.

R-54898-34554-42956-11210-21105-01944-03178-39152 tcl slt th3 src

When casting a TEXT value to REAL, the longest possible prefix of the value that can be interpreted as a real number is extracted from the TEXT value and the remainder ignored.

tcl/e_expr.test:1536

/* IMP: R-54898-34554 */
# EVIDENCE-OF: R-54898-34554 When casting a TEXT value to REAL, the
# longest possible prefix of the value that can be interpreted as a real
# number is extracted from the TEXT value and the remainder ignored.

R-11321-47427-17901-35193-41209-48737-39207-23278 tcl slt th3 src

Any leading spaces in the TEXT value are ignored when converging from TEXT to REAL.

tcl/e_expr.test:1545

/* IMP: R-11321-47427 */
# EVIDENCE-OF: R-11321-47427 Any leading spaces in the TEXT value are
# ignored when converging from TEXT to REAL.

R-22662-28218-11402-23235-34288-43676-21619-60718 tcl slt th3 src

If there is no prefix that can be interpreted as a real number, the result of the conversion is 0.0.

tcl/e_expr.test:1553

/* IMP: R-22662-28218 */
# EVIDENCE-OF: R-22662-28218 If there is no prefix that can be
# interpreted as a real number, the result of the conversion is 0.0.

R-21829-14563-51248-28780-63073-47174-17671-25024 tcl slt th3 src

When casting a BLOB value to INTEGER, the value is first converted to TEXT.

tcl/e_expr.test:1560

/* IMP: R-21829-14563 */
# EVIDENCE-OF: R-21829-14563 When casting a BLOB value to INTEGER, the
# value is first converted to TEXT.

R-47612-45842-47349-09557-45633-42955-42013-27541 tcl slt th3 src

When casting a TEXT value to INTEGER, the longest possible prefix of the value that can be interpreted as an integer number is extracted from the TEXT value and the remainder ignored.

tcl/e_expr.test:1588   th3/cov1/cast01.test:25

/* IMP: R-47612-45842 */
# EVIDENCE-OF: R-47612-45842 When casting a TEXT value to INTEGER, the
# longest possible prefix of the value that can be interpreted as an
# integer number is extracted from the TEXT value and the remainder
# ignored.

R-34400-33772-12568-07085-14602-53889-15876-12187 tcl slt th3 src

Any leading spaces in the TEXT value when converting from TEXT to INTEGER are ignored.

tcl/e_expr.test:1598   th3/cov1/cast01.test:30

/* IMP: R-34400-33772 */
# EVIDENCE-OF: R-34400-33772 Any leading spaces in the TEXT value when
# converting from TEXT to INTEGER are ignored.

R-43164-44276-05448-08571-37890-01247-49300-00926 tcl slt th3 src

If there is no prefix that can be interpreted as an integer number, the result of the conversion is 0.

tcl/e_expr.test:1606

/* IMP: R-43164-44276 */
# EVIDENCE-OF: R-43164-44276 If there is no prefix that can be
# interpreted as an integer number, the result of the conversion is 0.

R-48741-32454-48845-05465-27210-18049-43593-22824 tcl slt th3 src

If the prefix integer is greater than +9223372036854775807 then the result of the cast is exactly +9223372036854775807.

tcl/cast.test:348   th3/cov1/cast01.test:39

/* IMP: R-48741-32454 */
# EVIDENCE-OF: R-48741-32454 If the prefix integer is greater than
# +9223372036854775807 then the result of the cast is exactly
# +9223372036854775807.

R-06028-16857-64547-18047-60085-29491-06944-27148 tcl slt th3 src

Similarly, if the prefix integer is less than -9223372036854775808 then the result of the cast is exactly -9223372036854775808.

tcl/cast.test:357   th3/cov1/cast01.test:51

/* IMP: R-06028-16857 */
# EVIDENCE-OF: R-06028-16857 Similarly, if the prefix integer is less
# than -9223372036854775808 then the result of the cast is exactly
# -9223372036854775808.

R-33990-33527-11105-07702-18476-34779-54347-40484 tcl slt th3 src

When casting to INTEGER, if the text looks like a floating point value with an exponent, the exponent will be ignored because it is no part of the integer prefix.

tcl/cast.test:366

/* IMP: R-33990-33527 */
# EVIDENCE-OF: R-33990-33527 When casting to INTEGER, if the text looks
# like a floating point value with an exponent, the exponent will be
# ignored because it is no part of the integer prefix.

R-24225-46995-38973-17701-37772-12518-00219-22558 tcl slt th3 src

For example, "(CAST '123e+5' AS INTEGER)" results in 123, not in 12300000.

tcl/cast.test:369

/* IMP: R-24225-46995 */
# EVIDENCE-OF: R-24225-46995 For example, "(CAST '123e+5' AS INTEGER)"
# results in 123, not in 12300000.

R-08980-53124-31180-17843-61277-57445-45439-15186 tcl slt th3 src

The CAST operator understands decimal integers only — conversion of hexadecimal integers stops at the "x" in the "0x" prefix of the hexadecimal integer string and thus result of the CAST is always zero.

tcl/e_expr.test:1613

/* IMP: R-08980-53124 */
# EVIDENCE-OF: R-08980-53124 The CAST operator understands decimal
# integers only &mdash; conversion of hexadecimal integers stops at
# the "x" in the "0x" prefix of the hexadecimal integer string and thus
# result of the CAST is always zero.

R-02752-50091-50763-13370-06213-52053-61647-05504 tcl slt th3 src

A cast of a REAL value into an INTEGER results in the integer between the REAL value and zero that is closest to the REAL value.

tcl/e_expr.test:1620

/* IMP: R-02752-50091 */
# EVIDENCE-OF: R-02752-50091 A cast of a REAL value into an INTEGER
# results in the integer between the REAL value and zero that is closest
# to the REAL value.

R-51517-40824-40012-37469-09201-20241-42443-20040 tcl slt th3 src

If a REAL is greater than the greatest possible signed integer (+9223372036854775807) then the result is the greatest possible signed integer and if the REAL is less than the least possible signed integer (-9223372036854775808) then the result is the least possible signed integer.

tcl/e_expr.test:1629

/* IMP: R-51517-40824 */
# EVIDENCE-OF: R-51517-40824 If a REAL is greater than the greatest
# possible signed integer (+9223372036854775807) then the result is the
# greatest possible signed integer and if the REAL is less than the
# least possible signed integer (-9223372036854775808) then the result
# is the least possible signed integer.

R-55084-10555-33415-01077-58327-07092-00273-30693 tcl slt th3 src

Casting a TEXT or BLOB value into NUMERIC yields either an INTEGER or a REAL result.

tcl/cast.test:422   tcl/e_expr.test:1645   th3/cov1/cast01.test:84

/* IMP: R-55084-10555 */
# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
# yields either an INTEGER or a REAL result.

R-48945-04866-13752-27122-40545-48068-02764-57790 tcl slt th3 src

If the input text looks like an integer (there is no decimal point nor exponent) and the value is small enough to fit in a 64-bit signed integer, then the result will be INTEGER.

tcl/e_expr.test:1648   th3/cov1/cast01.test:87

/* IMP: R-48945-04866 */
# EVIDENCE-OF: R-48945-04866 If the input text looks like an integer
# (there is no decimal point nor exponent) and the value is small enough
# to fit in a 64-bit signed integer, then the result will be INTEGER.

R-47045-23194-06320-38835-32835-03422-03688-60752 tcl slt th3 src

Input text that looks like floating point (there is a decimal point and/or an exponent) and the text describes a value that can be losslessly converted back and forth between IEEE 754 64-bit float and a 51-bit signed integer, then the result is INTEGER.

tcl/e_expr.test:1652   th3/cov1/cast01.test:91

/* IMP: R-47045-23194 */
# EVIDENCE-OF: R-47045-23194 Input text that looks like floating point
# (there is a decimal point and/or an exponent) and the text describes a
# value that can be losslessly converted back and forth between IEEE 754
# 64-bit float and a 51-bit signed integer, then the result is INTEGER.

R-50300-26941-55863-56023-43928-35657-09281-24931 tcl slt th3 src

Any text input that describes a value outside the range of a 64-bit signed integer yields a REAL result.

tcl/e_expr.test:1675   th3/cov1/cast01.test:96

/* IMP: R-50300-26941 */
# EVIDENCE-OF: R-50300-26941 Any text input that describes a value
# outside the range of a 64-bit signed integer yields a REAL result.

R-30347-18702-41681-51017-11561-03801-56644-21815 tcl slt th3 src

Casting a REAL or INTEGER value to NUMERIC is a no-op, even if a real value could be losslessly converted to an integer.

tcl/e_expr.test:1687

/* IMP: R-30347-18702 */
# EVIDENCE-OF: R-30347-18702 Casting a REAL or INTEGER value to NUMERIC
# is a no-op, even if a real value could be losslessly converted to an
# integer.

R-64550-29191-54086-24811-00443-47986-21003-27772 tcl slt th3 src

Note that the result from casting any non-BLOB value into a BLOB and the result from casting any BLOB value into a non-BLOB value may be different depending on whether the database encoding is UTF-8, UTF-16be, or UTF-16le.

tcl/e_expr.test:1745

/* IMP: R-64550-29191 */
# EVIDENCE-OF: R-64550-29191 Note that the result from casting any
# non-BLOB value into a BLOB and the result from casting any BLOB value
# into a non-BLOB value may be different depending on whether the
# database encoding is UTF-8, UTF-16be, or UTF-16le.

R-48118-34840-54112-17431-20305-06499-24777-65466 tcl slt th3 src

To convert the results of an SQL expression to a boolean value, SQLite first casts the result to a NUMERIC value in the same way as a CAST expression. A numeric zero value (integer value 0 or real value 0.0) is considered to be false. A NULL value is still NULL. All other values are considered true.

th3/req1/expr03.test:14

/* IMP: R-48118-34840 */
# EVIDENCE-OF: R-48118-34840 To convert the results of an SQL expression
# to a boolean value, SQLite first casts the result to a NUMERIC value
# in the same way as a CAST expression. A numeric zero value (integer
# value 0 or real value 0.0) is considered to be false. A NULL value is
# still NULL. All other values are considered true.

R-62477-06476-47005-06861-24657-48512-17530-06708 tcl slt th3 src

For example, the values NULL, 0.0, 0, 'english' and '0' are all considered to be false.

tcl/e_expr.test:1950

/* IMP: R-62477-06476 */
# EVIDENCE-OF: R-62477-06476 For example, the values NULL, 0.0, 0,
# 'english' and '0' are all considered to be false.

R-55532-10108-63513-58109-24698-43338-62703-39415 tcl slt th3 src

Values 1, 1.0, 0.1, -0.1 and '1english' are considered to be true.

tcl/e_expr.test:1969

/* IMP: R-55532-10108 */
# EVIDENCE-OF: R-55532-10108 Values 1, 1.0, 0.1, -0.1 and '1english' are
# considered to be true.

R-59344-06440-62952-57613-16293-38554-64918-31058 tcl slt th3 src

It is possible to have an aggregate function with the same name as a simple function, as long as the number of arguments for the two forms of the function are different.

th3/req1/func05.test:12

/* IMP: R-59344-06440 */
# EVIDENCE-OF: R-59344-06440 It is possible to have an aggregate
# function with the same name as a simple function, as long as the
# number of arguments for the two forms of the function are different.

R-47913-44653-19019-51800-53744-51346-51796-57702 tcl slt th3 src

For example, the max() function with a single argument is an aggregate and the max() function with two or more arguments is a simple function.

th3/req1/func05.test:16

/* IMP: R-47913-44653 */
# EVIDENCE-OF: R-47913-44653 For example, the max() function with a
# single argument is an aggregate and the max() function with two or
# more arguments is a simple function.