Use database sql server command

    how to open a database in sql
    how to open a database in sqlite3
    how to open a database in sql server management studio
    how to open a database in sqlite
  • How to open a database in sql
  • How to create database in sql...

    How to create database in sql server

  • How to connect sql server management studio to local database
  • How to create database in sql
  • How to connect to a sql server database from local pc
  • Connect to sql database command line
  • 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

      how to open a database in sql server
      how to open a db in sqlite