DEV Community

Abubakar Sadiq Sirajo
Abubakar Sadiq Sirajo

Posted on

2 2

UPDATE > MariaDB

The UPDATE command helps us to change or modify the records that have already been inserted into a table. You can combine it with the WHERE clause to specify the record that is to be updated. Here is the syntax:

UPDATE tableName SET field=newValue, field2=newValue2,...  
[WHERE ...]  
Enter fullscreen mode Exit fullscreen mode

The UPDATE command can also be combined with clauses such as SET, WHERE, LIMIT, and ORDER BY. You will see this shortly:

Let’s change the price of the book with an id of 1 from 200 to 250:

UPDATE price 
SET price = 250
WHERE id = 1;
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more