UPDATE QUERY



MySQL - Update Query


Update statement is used to modify the existing records in a table.


SYNTAX

UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;

First we will assume a table with details:


StudentIdStudentNameParentNameAddressPostalCodeCity
1SanjanajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenCamel street700096Kolkata

NOW,lets check out how the UPDATE query works:


Example - Update single column


UPDATE studentrecord
SET StudentName = 'Anasya'
WHERE StudentID = 1;

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
1AnasyajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenCamel street700096Kolkata

Example - Update multiple columns :


UPDATE studentrecord
SET Address = 'Hayath nagar',
    City = 'Noida'
WHERE StudentID = 2;

The result will be displayed as follows:

StudentIdStudentNameParentNameAddressPostalCodeCity
1AnasyajagannathBanjara Hills500046Hyderabad
2ShivanatiniPraveenHayath nagar700096Noida


MySQL TRIGGERS

MySQL - Triggers

posted on 2019-11-29 21:44:07 - mysql Tutorials


Grant_ Revoke Privilege

MySQL - Grant_ Revoke Privilege

posted on 2019-11-26 23:15:04 - mysql Tutorials


MySQL Vs SQL

MySQL Vs SQL

posted on 2019-11-25 05:02:26 - mysql Tutorials


What Is Oracle

What Is Oracle

posted on 2019-11-29 01:11:21 - ORACLE Tutorials


TRIGGER

ORACLE - Trigger

posted on 2019-11-28 22:14:22 - ORACLE Tutorials


CURSOR

ORACLE - Cursor

posted on 2019-11-28 22:13:54 - ORACLE Tutorials