The DATABASE() function returns the current database name as a string.
If no default database is defined, the DATABASE() function returns NULL.
Within stored routines, the default database is the database associated with the routine.
A database can be selected with the USE statement. |