Showing posts with label Insert Update and Delete Query in Structured Query Language. Show all posts
Showing posts with label Insert Update and Delete Query in Structured Query Language. Show all posts

Monday, October 5, 2020

Insert, Update and Delete Query in Structured Query Language


 

  1. SQL Insert Into Query 

      Syntax : Insert Into tablename (column1,column2, column3,........) 

                     Values(value1,value2,value3,............) 

      Function: The Insert query is used  to insert records in a database

      Example: Insert Into Employees(Empid, EmpName, EmpAddress, Empphone)

                       Values(1,'Ana Johnson','New York', 12345676);

 

2. SQL Update Query :

   Syntax: Update Tablename set column1 = value1, column2-=value2 ,

                 column3="value4"   where condition ;

   Function: The update query is used to modify a data in a database.

   Example: Update Employees set  EmpName="Sashank",

                     EmpAddress="Sweden" where  Empid = 3;

 

3. SQL Delete Query:

    Syntax: Delete from tablename where condition ;

    Function: This query is used to delete a record of a table.

    Example: Delete from Employee where EmpName="Ana Johnson";