Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
Text lesson

DATABASE

Example

Retrieve the name of the currently selected (default) database.

SELECT DATABASE();

Definition and Usage

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

If no database is currently selected, the function returns NULL or an empty string.

Syntax

DATABASE()

Technical Details

Works in:

 From MySQL version 4.0