SQL Course: a Query to UPDATE Your Data

Publié le: 12 juillet 2025
sur la chaîne: Database Dive
15
1

Timestamps for this SQL course:
00:00: Introduction to the UPDATE SQL Query
01:33: Filtering Rows to Update with the WHERE SQL Clause
03:03: Updating Multiple Columns

Welcome to this full SQL course on the UPDATE SQL query! This SQL course will walk you through the basics of updating data in relational database management systems like MySQL.

In its most basic form, the UPDATE SQL query looks like so:
UPDATE `table` SET `column` = 'Value';

The problem with this SQL query, though, is if we execute this SQL query, all of our rows in a column will be updated because we didn't specify a WHERE clause.
Some SQL clients like Arctype, DbVisualizer, or phpMyAdmin (if we're running MySQL Server) will inform us about the consequences of our actions before we execute such a SQL query, others won't.

To avoid updating all rows in a table, use the SQL UPDATE query together with the WHERE clause - the WHERE clause lets you specify what specifically to update:
UPDATE `table` SET `column` = 'Value' WHERE [condition];

If you want to update a specific set of data, say, a row of ID 7, you would invoke the SQL UPDATE query like so:
UPDATE `table` SET `column` = 'Value' WHERE `id` = 7;

Now your database will understand the SQL query properly and it will no longer update the entire table. Execute the SQL query once again and one row will be affected.

To update multiple columns, utilize the UPDATE SQL query like so:
UPDATE `table` SET `column` = 'Value', `column_2` = 'Value 2', ... WHERE `id` = 7;

Basically, specify the columns to update the data in after the comma.

Music:
Future by KV:    / kvmusicprod  
License: Creative Commons. Attribution 3.0 Unported. CC BY 3.0
Free Download / Stream: https://www.audiolibrary.com.co/kv/fu...
Music promoted by Audio Library:    • Chill, Lofi, Electronic No Copyright Music...  

#coding #database #sql #programming #mysql


Sur cette page du site, vous pouvez voir la vidéo en ligne SQL Course: a Query to UPDATE Your Data durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Database Dive 12 juillet 2025, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 15 fois et il a aimé 1 téléspectateurs. Bon visionnage!