DATABASE
Return the default database name. This function outputs the name of the currently selected database for the session.
Syntax
DATABASE()
SCHEMA()Description
Examples
SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| NULL |
+------------+
USE test;
Database changed
SELECT DATABASE();
+------------+
| DATABASE() |
+------------+
| test |
+------------+Last updated
Was this helpful?

