How to Create, Use, and Drop an SQL Database?
In the world of data and web development, understanding database management is vital. SQL (Structured Query Language) is the standard language for creating, getting, and managing databases. In this beginner-friendly instruction, you’ll learn how to create an SQL database, select it for use, and even remove it when it’s no longer required. Let’s start with the basics of SQL databases.
Table of Contents
What is an SQL Database?
A database contains records, and to create, modify, or delete these records SQL queries are used. An SQL query can either be an action query like delete or create or a select query like select or use. These queries are used to find specific data, perform actions on it, or just display data by filtering based on specific criteria.
A database is an organized collection of data. How do we create or insert data into the database? Well, that’s done by writing a database query. In this SQL Database tutorial section, we will discuss the queries related to the SQL Database
-
- How do we Create an SQL Database?
- How do we Use an SQL Database?
- How do we Delete or Drop an SQL Database?

How to Create a Database in SQL?
To Create a Database in SQL, you should follow the below command
Syntax:
CREATE DATABASE databasename;
where CREATE DATABASE is the keyword and databasename is the name of the database, followed by a semicolon.
Steps on how to Create a Database in SQL
-
- Open the SQL software and create a new query by clicking on New Query
- Type the syntax and give a name for your database (Here, we are creating a database ‘happy’)
CREATE DATABASE happy;
-
- Then hit You will see that your commands are executed successfully, and your table is created.
- Click on Refresh [ ] and you will find a database happy created in Object Explorer

How to Use (Select) a Database in SQL?
To Select and use a Database in SQL
Syntax:
USE databasename;
where USE is the keyword, and databasename is the name that we want to use (select it from the existing database names), followed by a semicolon.
Once the database is selected, it remains default until another USE statement with a different database is used. To check which database you’re using, place your mouse pointer over the file where you’re executing the query.
How to Select a Database?
- Here in the above image, the default database is the previously selected as SPARATA
- To select the ‘happy’ database, give the command
USE happy;
- Hit Execute and the database is selected

How to Drop (Delete) a Database in SQL
To delete a database
Syntax:
DROP DATABASE databasename;
where DROP DATABASE is the keyword and databasename is the name of the database we want to delete, followed by semicolon.

Delete an SQL Database
-
- Here, we are deleting the igneous database; hence give the following command:
DROP DATABASE igneous;
-
- Then hit Execute and Click on Refresh [ ], and the igneous database would not be displayed on Object Explorer

Conclusion
Knowing how to create, select, and remove databases in SQL is an essential ability for web development and data administration. You may easily manage your databases with a few easy instructions. To avoid accidental data loss, double-check databases before removing them and set up regular backups. Once you’re comfortable with the basics, you’ll be ready to move on to more advanced SQL concepts such as tables, queries, joins, and stored procedures.
Our SQL Courses Duration and Fees
Cohort Starts on: 31st May 2025
₹15,048
Cohort Starts on: 7th Jun 2025
₹15,048