SQL Course: a Query to UPDATE Your Data

Опубликовано: 12 Июль 2025
на канале: 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


На этой странице сайта вы можете посмотреть видео онлайн SQL Course: a Query to UPDATE Your Data длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Database Dive 12 Июль 2025, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 15 раз и оно понравилось 1 зрителям. Приятного просмотра!