MySQL DATABASE Function

Example

Return the name of the current (default) database:

SELECT DATABASE();

Definition and Usage

The DATABASE() function returns the name of the current database.

If there is no current database, this function returns NULL or “”.

Syntax

DATABASE()

Continue reading MySQL DATABASE Function

MySQL DATE Function

Example

Extract the date part:

SELECT DATE("2017-06-15");

Definition and Usage

The DATE() function extracts the date part from a datetime expression.

Syntax

DATE(expression)

Continue reading MySQL DATE Function