TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

SQL SELECT Database

SQL select database query with sql, tutorial, examples, insert, update, delete, select, join, database, table, join

<< Back to SQL

SQL SELECT Database

Suppose database users and administrators want to perform some operations on tables, views, and indexes on the specific existing database in SQL. Firstly, they have to select the database on which they want to run the database queries.

Any database user and administrator can easily select the particular database from the current database server using the USE statement in SQL.

Syntax of USE statement in SQL

USE database_name; 

In this syntax, we have to define the name of the database after the USE keyword and the name of the database must be unique.

Syntax of USE statement in MySQL

USE database_name; 

Syntax of USE statement in Oracle

There is no need to select the database in Oracle.

Examples of USE statement in SQL

In this article, we have taken the following three examples which will help you how to run and perform USE statement in SQL:

Example 1: Suppose, you want to work with the Hospital database. For this firstly, you have to check that if the Hospital database exists on the current database server or not by using the following query:

SHOW DATABASES;

If the Hospital database is shown in the output, then you have to execute the following query to select the Hospital database:

USE Hospital;

Example 2: Suppose, you want to work with another College database in SQL. For this firstly, you have to check that the College database exists on the current database server or not by using the following query:

SHOW DATABASES;

If the College database is shown in the result, then you have to execute the following query to select the College database:

USE College;

Example 3: Suppose you want to work with another School database in SQL. For this firstly, you have to check that the School database exists on the current database server or not by using the following query:

SHOW DATABASES;

If the School database is shown in the result, then you have to execute the following query to select the School database:

USE School;

Next TopicSql TABLE




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf