SQL Database Operations:-
Below are the list of operations which can be perform on SQL database.
1- Create Database
2- Drop Database
3- Rename Database
4- Select Database
5- Backup Database.
1. Create Database :-
The "CREATE DATABASE" statement is used to create new SQL database.
Syntax : CREATE DATABASE databasename;
Example : CREATE DATABASE StudentDB
2. Drop Database :-
The DROP DATABASE statement is used to drop an existing SQL database.
Syntax : DROP Database databasename;
Example : DROP DATABASE StudentDB;
3.Rename Database :-
Rename Database statement in SQL is used to change the name of the existing database.
Syntax of Rename Database in SQL(two Options)
- ALTER DATABASE old_database_name MODIFY NAME = new_database_name;
- EXEC sp_renamedb'old_database_name' , 'new_database_name'
4 - Backup Database :
The BACKUP DATABASE statement is used in SQL Server to create a full back up of an existing SQL database.
BACKUP DATABASE StudentDB
TO DISK = 'D:\backups\StudentDB.bak';