Important
New database features are no longer connected to engine versions; features are now enabled independently during scheduled update windows, and “major” and “minor” releases no longer exist in Helios. Please visit the release notes to view the latest features available in your database clusters.
DATABASE
On this page
The DATABASE() function returns the name of the currently selected database.
If no database is selected, then this function returns NULL.
Syntax
DATABASE()
Return Type
String.
Example
Without a database specified:
SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| NULL |
+------------+With a database specified:
USE trades;SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| trades |
+------------+Last modified: