HomeОбразованиеRelated VideosMore From: itgeared

The SQL UPDATE Statement

117 ratings | 35353 views
This video tutorial covers how to update fields in a SQL database table, using the SQL UPDATE statement. More guides and tutorials: http://www.itgeared.com/.
Html code for embedding videos on your blog
Text Comments (17)
365 Data Science (3 months ago)
Great video! You can also check out our Learn How to use the SQL Update Statement with Real Data video: https://www.youtube.com/watch?v=rnglWSZjEbM. Hope you like it! :)
piano0011 Lee (11 months ago)
correct me if I am wrong but if I want to insert a function, do I need to place a '' around it? I tried it without it and it does work.
aRrOwHoN (1 year ago)
This website can help with MSSQL update statements... http://smallhustle.com/
RSB PRODUÇÕES (1 year ago)
Gostaria de saber se é possivel criar um sql para gerar uma sequencia em uma tabela ja existente, tipo assim UPDATE CLIENTE SET CODIGO = CODIGO + 1, nesse nao nao da certo pois vai ficar tudo com 1 senod que o campo codigo é 0
lldd11 (2 years ago)
The tutorial is false. In WHERE clause you should be using Primary Key, which would be a unique value, otherwise people will ran into issue of updating wrong record, like you just did. Especially if you have a lot of data (and most of the time you do)
itgeared (2 years ago)
You can include additional fields in your WHERE clause. There is nothing false about it.
abdülmütalip gül (3 years ago)
Thanks for your videos, i thinks so that for the beginner users
Curiosity (4 years ago)
Great video. Thank you
Les Paul (4 years ago)
If the column is empty and contains no data, what is the point of using the UPDATE statement when you can just use the INSERT INTO statement? Isn't the whole point of the UPDATE to essentially change the data that already exists? 
Les Paul (4 years ago)
+itgeared Ah I see, thanks for clarifying that for me. 
itgeared (4 years ago)
If an existing column (field) is empty (null), you would need to use the SQL UPDATE statement to modify the data in that field.  If there is no existing record (row of data), you must use the INSERT INTO statement to create a new record in your table.  After the record (row) is created, you can use the UPDATE statement to modify data in the fields.
NWSanta (5 years ago)
Thank you!!!!! I have been fighting with this all morning. Your video helped me through what I needed to do! Thanks so much!
friend need that after a UPDATE I return some value if you have made any changes in this table
123japanuser (5 years ago)
itgeared (7 years ago)
@huejiitechx - If you want to update all records in a single column, the statement would be as follows: "update table_name set column_Name = "value". of course change "table_name" to your table and "column_name" to the name of the column that you want to update. That command will update the same value for all of the records in the column you specify. If you add the where clause, then you would only update one or more records. More information at itgeared.com/1108-sql-update-statement.
huejii tech (7 years ago)
i want to update a records in a single column.. not set how do i do that???
Andrew Rodriguez (7 years ago)
I'm in the process of learning SQL, thanks!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.