In this video you will learn how to Create, Alter, Drop Database Using SQL Syntax and using GUI. SQL Online Course https://way2achieve.teachable.com/p/m...
How To Create/Alter/Drop Database In SQL Server Using Syntax
https://way2achieve.teachable.com/blo...
Blog
https://way2achieve.teachable.com/blog
Follow Us On
/ way2achieve
In this video you will to learn how to Create, Alter, Drop Database Using GUI. Using SQL server management studio you can also create or Alter or Drop Database without SQL query.
How to create a database?
To create a database you have to use Create Database syntax. So Create database and the name of the database.
Let's say you want create a database called MyLearningDB.
So the syntax will be Create Database MyLearningDB;
Once you execute the SQL syntax
You will get the message "Command(s) completed successfully."
How To Rename A Database?
Use Alter keyword when you have to modify something in an existing object.
So the syntax to rename a database is ALTER DATABASE Database_Name
Modify Name = New_Database_Name;
If you want to rename the database from MyLearningDB to MyLearning, the syntax is going to be ALTER DATABASE MyLearningDB Modify Name = MyLearning;
Once you execute this SQL syntax you will get the message "The database name 'MyLearning' has been set."
How to delete the database?
Use Drop keyword when you have to delete existing object. The syntax to delete a database is DROP Database Database_Name;
If you want to delete your database MyLearning so the syntax is going to be DROP Database MyLearning;
Once you execute it you will get the message "Command(s) completed successfully.”.