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


how to use range in golang

how to use range in golang

posted on 2022-05-03 08:28:11 - Go lang Tutorials


find variable type in golang

find variable type in golang

posted on 2022-05-03 05:24:55 - Go lang Tutorials


for loops in golang

for loops in golang

posted on 2022-05-03 04:27:40 - Go lang Tutorials