This tutorial explains how to use the MySQL DATABASE function with syntax and examples.
The MySQL DATABASE function returns the name of the default database.
The syntax for the DATABASE function in MySQL is:
There are no parameters or arguments for the DATABASE function in MySQL.
The DATABASE function can be used in the following versions of MySQL:
Let's look at some MySQL DATABASE function examples and explore how to use the DATABASE function in MySQL.
For example:
This DATABASE function example would return the name of the default database. So if our default database was called quotations, this example would return the string 'quotations'.