0 votes
in MariaDB by
How to use database in MariaDB?

1 Answer

0 votes
by
USE DATABASE command is used to select and use a database in MariB. The USE db-name' statement tells MariB to use the db_name database as default (current) database for subsequent statements. The database remains the default until the end of the session, or another USE statement is issued:

Syntax:

USE database_name;     

Example

USE student;  

SELECT COUNT (*) FROM mytable;    # selects from student.mytable  

USE faculty;  

SELECT COUNT (*) FROM mytable;    # selects from faculty.mytable  

The DATABASE () and SCHEMA () returns the default database.
...