Tuesday, October 6, 2020

Database Queries in Standard Query Language

 

 
 

     1. The SQL Create Database statement:

          Syntax: Create database databasename ;

          Function: This statement is used to create a new database.

          example: Create database mydb1;

 

  2. The SQL Drop statement.

      Syntax: Drop Database databasename;

      Function: The Sql drop statement is used to delete an existing database

      example. Drop database mydb1; 


3.The SQL  Backup statement.

    Syntax: Backup Database databasename to disk ='filepath';

    Function: This statement is used to create  a full backup of existing database.

    example: Backup database mydb1 to disk ="D:\My Details";

 

4. The SQL Backup with Differential statement :

    Syntax: Backup database databasename to disk ='filepath' with differential;

    Function: This  statement is used to  keep backup of the database that have 

                      changed since the last full backup done .

     Example:  Backup database mydb1 to disk ="D:\My Details"  with differential;


5.The SQL create table statement:

    Syntax : Create table tablename{    column1 datatype,

                                                             column2 datatype,

                                                             column3 datatyoe

                                                           } 

   Function: This statement is used to create a new table in database.

  example: create table customers: { ID int(4)  Primary key,

                                                          name  Text(20)

                                                          address  Text(20)

                                                         };

6..The SQL Drop table statement:

     Syntax: Drop table tablename;

    Function: This statement is used to delete a table   from a database.

    example: Delete table customers; 

 

7. The SQL  Alter table statement:

    Syntax:Alter table tablename add columnname datatype;

    Function:  This statement is used to add and  modify data in a table

    example: Alter table customers add phonenumber int(12);



  


    


No comments:

Post a Comment