Sql use schema
- how to use database in sql server
- how to access database in sql server
- how to take database backup in sql server
- how to take database offline in sql server
Sql use command
Use database command!
SQL - SELECT Database, USE Statement
To work with a database in SQL, we need to first select the database we want to work with. After selecting the database, we can perform various operations on it such as creating tables, inserting data, updating data, and deleting data.
The USE DATABASE Statement
The SQL USE DATABASE statement is used to select a database from a list of databases available in the system.
Once a database is selected, we can perform various operations on it such as creating tables, inserting data, updating data, and deleting data.
Syntax
Following is the syntax of the USE DATABASE statement in SQL −
USE DatabaseName;Here, the DatabaseName is the name of the database that we want to select.
The database name is always unique within the RDBMS.
Example
First of all we will create a database using the following SQL CREATE DATABASE query −
CREATE DATABASE testDB;Now, we can list all the available databases as follws −
SHOW DATABASES;The output will be displayed as −
| Database |
|---|
| master |
| performance_schema |
informat
|