;

SQL USE


In this tutorial, we will learn how to use USE statement using for selecting a database.

SQL USE Statement

SQL USE statement is used to select a database and perform SQL operations into that specific database.

The database remains the default/same until session end or execution of another USE statement with some other database.

Syntax - USE Statement
USE databaseName;

Here "databaseName" is the name of the database you want to be selected for SQL operations.

Example

To select a database, a query will be:

Syntax - USE Statement
USE test_db;