Learn How to Delete or Remove Database using SQL

preview_player
Показать описание
Learn how to remove or delete a database from the database management system using SQL statement. Using standard SQL we can create as as well as remove the database from our database management system. The DROP DATABASE SQL statement is used to remove or delete the database including all the tables and data rows in it. Be careful before deleting the database completely from your database management system because the system does not ask for confirmation. As soon as you run the SQL DROP DATABASE statement, the system will remove the database, tables and data rows instantly and there is no easy method to recover the lost database.

Here is the SQL statement to delete the database. "DROP databasename;".
First of all lets display all the existing databases using SQL statement, "SHOW DATABASES;" The system displays all the available database.
In previous lecture we created 2 databases called '1234d' and 'my_database'. Lets delete the database '1234d',
The SQL statement will be, "DROP DATABASE 1234d;" and we get 'Query OK, 0 rows affected' message
Now, if display all the existing databases using SQL statement, "SHOW DATABASES;" the database '1234d' is gone.

Check out the whole playlist of SQL Tutorials or Individual video from the following links,

SQL Tutorial for Beginners. Introduction to SQL Basics

1.Learn What is SQL? Introduction to SQL

2.Learn How to Install MySQL Database Server on Windows Operating System

3.Learn What is Database? How to Create and Show Databases using SQL

4.Learn How to Select and Use Existing Database using SQL

5.Learn How to Delete or Remove Database using SQL

6.Learn What is Database Table? How to Create a Database Table using SQL?

7.Learn How to Modify or Update Database Table using SQL

8.Learn How to Delete or Remove Database Table using SQL

9.Learn How to Add Data Rows in a Table using SQL

10.Learn How to Use INSERT INTO SELECT Statement in SQL

11.Learn How to Update Data Rows using Update Statement in SQL

12.Learn How to Delete Data Rows using Delete Statement in SQL

Рекомендации по теме
Комментарии
Автор

Please I need a T-SQL script to delete multiple or all user databases in a server/instance

FelixNkongho
Автор

Hello ! Does this also apply to deleting a DB in a SQL cluster? Is deleting with a drop command (or delete via SQL Studio) enough, or is there still work to be done? (e.g. what about the availability groups, listeners) ? Thank you for your help.

MK-fdem
Автор

it is kind of not working

after the command its just stuck
and this is happening with only one particular database

dhairyaagarwal
Автор

Sir can u tell me how to clear screen of MySql in windows 8

nadirshaikh