Home » Database » How to update or change data in a MySQL table

How to update or change data in a MySQL table

Changing data in a MySQL table using command line command is not as complicated as it sounds, and the basic problem is the way commands are written in various tutorials and manuals. If you want to update data in a MySQL table, alter a column or a low, you can modify your MySQL command accordingly.

Suppose you want to change data in a single MySQL table cell. In order to achieve this you need to know the name of the column that contains the cell, the row number, or some trait that can uniquely identify that cell. Normally, a complete row in a MySQL table is a complete record and this record is distinguished by a unique record ID, let is say, “rec_id”. Suppose the cell you want to change belongs to rec_id 678 and the name of the cell is “first_name”. Let the MySQL table be “students”. This is how you change the first_name:

update students set first_name=’Suba’ where rec_id=678;

Isn’t it a straightforward command? No matter what value first_name originally contains, it now has Suba in it. Notice that you don’t write “update table students”, you simply write “update students”.

3 thoughts on “How to update or change data in a MySQL table

  1. Origami Folder

    Excellent, thank you!
    When you wrote the mysql command, it would really help to change the look of the mysql commands and the variables, to make it more visual.
    UPDATE students SET first_name=’Suba’ WHERE rec_id=678;
    Or color, italics, etc. Thanks!

  2. Pingback: ccn2785xdnwdc5bwedsj4wsndb

  3. Pingback: 3nvb54wnxd5cbvbecnv5ev75bc

  4. Pingback: xnc5bsxnrbscngfrfgc4ecgdgf

  5. Pingback: mxcn5w7xmwncwexnicensrgffg

  6. Pingback: xm8entv5yf4h65ddeoivgh9545

  7. Pingback: gvhndct5evs5jctsnv5eyscosh

  8. Pingback: xmmmmmrg83444444444trwx8md

  9. Pingback: cw4xyk5iusy8fn4rwjrtnuyfgw

  10. Pingback: Free Piano

  11. Pingback: Wholesale NFL Jerseys China

Leave a Reply