From the course: MySQL Essential Training
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Updating data - MySQL Tutorial
From the course: MySQL Essential Training
Updating data
- [Bill] Hi, I am Bill Weinman. The update statement is used to change data in existing rows in a table. This lesson, we're using the scratch database. So I'll type use scratch and that opens the scratch database for our use. And when I SELECT * FROM customer, you notice that we still have the data from our previous lesson on inserting rows. And we're going to use this data for this lesson. So I can say SELECT * FROM customer WHERE name LIKE and then Jimi with a percent symbol and close my single quotes. And when I execute this, we notice we just get that one row with the ID five and the name Jimi Hendrix. So the where like clause allows us to filter a row based on a string. The percent symbol is used as a wild card in SQL. So we can say WHERE name LIKE Jimi% and it gives us any rows where the name column string starts with the characters J-I-M-I. And so we just get that one row. We can use this same WHERE LIKE clause in an UPDATE statement, right? So I'm going to go ahead and copy…
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 28s
-
(Locked)
Database organization2m 51s
-
(Locked)
Selecting rows5m 47s
-
(Locked)
Selecting columns2m 21s
-
(Locked)
Counting rows3m 5s
-
(Locked)
Inserting data3m 26s
-
(Locked)
Updating data4m 12s
-
(Locked)
Deleting data4m 10s
-
(Locked)
Joining queries across tables3m 57s
-
(Locked)
Finding databases, tables, and columns1m 24s
-
-
-
-
-
-
-