Question 26
In SQL pattern matching using the LIKE operator, which wildcard character matches any sequence of zero or more characters?
In SQL LIKE clauses, '%' matches zero or more characters, while '_' matches exactly one single character.
In SQL pattern matching using the LIKE operator, which wildcard character matches any sequence of zero or more characters?
In SQL LIKE clauses, '%' matches zero or more characters, while '_' matches exactly one single character.
To find all student names where the second letter is 'a', which SQL LIKE condition should be used?
The underscore '_' represents exactly one leading character, followed by 'a', and '%' matches any remaining sequence of characters.
How must NULL values be tested in an SQL WHERE clause?
Because NULL represents an unknown value, direct comparison using '=' or '!=' evaluates to UNKNOWN (Three-Valued Logic). Thus, IS NULL or IS NOT NULL must be used.
What is the result of the SQL logical expression: (NULL = NULL)?
In SQL's three-valued logic (3VL), comparing NULL to any value, including another NULL, yields UNKNOWN rather than TRUE or FALSE.
Which SQL clause sorts the retrieved records in ascending or descending order?
The ORDER BY clause is used to sort the result set in ascending order (ASC, default) or descending order (DESC).