Database Information

VERSION() returns the MySQL server version. DATABASE() (synonym: SCHEMA()) returns the current default database name. CONNECTION_ID() returns the ID of the current connection.
SELECT VERSION(), DATABASE(), CONNECTION_ID();

Identity

USER(), SESSION_USER(), and SYSTEM_USER() return the current client's username and hostname as supplied when connecting. CURRENT_USER / CURRENT_USER() instead returns the username/hostname combination actually used to authenticate — which can differ from USER() when a proxy user or an anonymous account is involved.

LAST_INSERT_ID() returns the first automatically generated value from the most recent INSERT into an AUTO_INCREMENT column on the current connection. ROW_COUNT() returns the number of rows affected by the most recent statement.
INSERT INTO tbl (name) VALUES ('a'), ('b'), ('c');
SELECT LAST_INSERT_ID(), ROW_COUNT();

LAST_INSERT_ID() returns the id generated for the first of the three rows; ROW_COUNT() returns 3.


CREATE TABLE tbl (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(10));
INSERT INTO tbl (name) VALUES ('a'), ('b'), ('c');

SELECT LAST_INSERT_ID(), ROW_COUNT();

Query OK, 3 rows affected
LAST_INSERT_ID()ROW_COUNT()
13

Character Set and Collation

CHARSET(str) returns the character set of str. COLLATION(str) returns the collation of str. COERCIBILITY(str) returns an integer reflecting how strongly str's collation would win when compared against a value with a different collation — lower values are more coercible (explicit literals are highly coercible; an explicit COLLATE clause is not coercible at all).

Benchmarking

BENCHMARK(count, expr) executes expr count times and always returns 0; it is used to measure how long an expression takes to evaluate, with the timing reported by the client rather than as a return value.
SELECT BENCHMARK(1000000, MD5('test'));

SELECT BENCHMARK(1000000, MD5('test'));

BENCHMARK(1000000, MD5('test'))
0

-- VERSION(), DATABASE(), CONNECTION_ID(), USER(), CURRENT_USER(), and the
-- default CHARSET()/COLLATION() all depend on the specific server install
-- and session, so none has a fixed result to show here.
SELECT VERSION(), DATABASE(), CONNECTION_ID();
SELECT USER(), CURRENT_USER();
SELECT CHARSET('abc'), COLLATION('abc'), COERCIBILITY('abc');