From the course: MySQL Essential Training (2019)
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Updating data - MySQL Tutorial
From the course: MySQL Essential Training (2019)
Updating data
- [Instructor] The update statement is used to change data in existing rows in a table. For this lesson, we'll use the scratch database. Here in MySQL Workbench, I'm connected with my admin connection and I'm just going to type use scratch and execute and we're now using the scratch database. So, if I select asterisk from customer and execute, you see we have these five rows. This includes the two rows that we added in the previous lesson on the insert statement. Now, if I use a where clause in my select statement, I say where name like and Jimi with a percent symbol. The percent is a wildcard in the like clause and it means any series of characters, so zero or more of any character. And so when I execute this statement, it only returns the rows where the name column begins with the characters J-I-M-I. Now I can use that same where clause in an update statement, so instead of select asterisk from, I can say update customer and then I can set values with the set clause. Set address…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
A brief overview of SQL4m 39s
-
(Locked)
Database organization2m 58s
-
(Locked)
Selecting rows5m 32s
-
(Locked)
Selecting columns2m 26s
-
(Locked)
Counting rows2m 2s
-
(Locked)
Inserting data3m 14s
-
(Locked)
Updating data3m 56s
-
(Locked)
Deleting data4m 47s
-
(Locked)
Joining queries across tables4m 8s
-
(Locked)
Finding databases, tables, and columns1m 40s
-
-
-
-
-
-
-