What is the reason that the following two queries give wildly different results?
MariaDB [mydatabase]> SELECT COUNT(DISTINCT(`price`)) FROM `products`; --
A straight single quote (') is used for string literals (along with straight double quote (")).
A backtick quote (`) is for quoting identifiers.
Identifiers must be quoted if they match a reserved word, or if they contain special characters. Quoted identifiers also can specify lowercase in case-insensitive fields (which otherwise might be shown as uppercase).
CREATE TABLE MyTable (Field INT);
DESCRIBE MyTable;
+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| FIELD | INT | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
See also ANSI quote mode.