Category: Database
-
Backup Database
In this SQL Backup Database tutorial, we will explain how we can take a backup of a database in MySQL and MS SQL Server. It is very important and basic development practice to have a backup of the database in case the original is corrupted or lost due to power surges or disk crashes etc. By practicing this,…
-
Show Databases
Many a times you face a situation where you need to list down all the available databases. MySQL provides a convenient way to list down all the databases using SHOW DATABASES command where as there is no particular command in MS SQL Server to show or list the databases but, you can use the SELECT…FROM command as a work…
-
Rename Database
There can be several reasons to rename a database name. One of the reasons could be to avoid naming conflicts or to separate different types of data into different databases. Another reason can be to arrange them in an organized way which makes them more descriptive and easier to manage. The ALTER DATABASE…MODIFY Statement The ALTER…
-
Select Database
To work with a database in SQL, we need to first select the database we want to work with. After selecting the database, we can perform various operations on it such as creating tables, inserting data, updating data, and deleting data. The USE DATABASE Statement The SQL USE DATABASE statement is used to select a database from…
-
Drop Database
The SQL DROP DATABASE statement is used to delete an existing database along with all the data such as tables, views, indexes, stored procedures, and constraints. SQL DROP Database Statement Following are the important points to remember before you delete an existing database − Syntax Following is the syntax to delete a database in SQL − DROPDATABASE DatabaseName; Here,…
-
Create Database
A database is a structured collection of data that is stored in a computer system. They are used to store and retrieve the data efficiently. Databases can be created using different query languages, and SQL is one such language. CREATE Database Statement The CREATE DATABASE statement is a DDL (Data Definition Language) statement used to create a new database…