Murach's MySQL Flashcards
What is the default date format used by MySQL?
YYYY-MM-DD
What are the two ways to express a ‘not equals’ comparison operator in a where clause?
<>
!=
Are character comparisons performed on a MySQL database case sensitive?
No
If you compare a null value to one of the comparison operators (=, <, > etc), the result will always be a null value. To test for null values, use the ______ clause instead.
IS NULL
Which two functions can be used to explicitly convert a data type?
CAST
CONVERT
What is the order of precedence for the three logical operators?
- NOT
- AND
- OR
Are the two expressions used in the BETWEEN phrase for the range of values inclusive?
Yes
What are the two operators you can use to match a specific pattern or mask?
LIKE
REGEXP
The LIKE operator is an older operator that lets you search for simple string patterns. The mask can contain one or both of which wildcard symbols?
% (matches any string of zero or more characters)
_ (matches any single character)
Can searches using the LIKE or REGEXP operator use a table’s indexes?
No
Are masks used in the LIKE or REGEXP operators case sensitive?
No
What is the clause used to test whether a column contains a null value?
IS NULL
What is the clause used for specifying the sort order of a result set? And what is the default sequence (ASC or DESC)?
ORDER BY
ASC is the default, so it can be omitted if that’s the sort order required
What is a nested sort?
To sort by more than one column, you may simply list them in the ORDER BY clause separated by commas.
True or false: null values appear first in the sort sequence, even if using DESC.
True