Tutorials Hut

  • SQL Testing




  • SQL Update Statement with Example

    SQL update Statement is used to update/modify existing records/values in a table.

    Syntax

    UPDATE Table SET column_name =value [WHERE condition]

    Update All Rows

    UPDATE table
    SET column_name = value;

    Update specific row

    UPDATE table
    SET column_name = value;
    WHERE conditions ;

    Update Multiple Columns

    UPDATE table
    SET column1 = ‘value1’ ,
    column2 = ‘value2’ ,
    WHERE conditions;

    Example:

    EMPLOYEE table having below records:

    SQL Update Statement _1

    Updating Employee table

    mysql> Update Employee Set CITY='LUCKNOW' where Employee_FirstName='Kalp';
    Query OK, 1 row affected (0.36 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    Result after updating Record

    SQL Update statement 2_Results



  • SQL Testing














  • Leave a Reply

    Your email address will not be published. Required fields are marked *