From the course: MySQL Database Administration
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Updating data records - MySQL Tutorial
From the course: MySQL Database Administration
Updating data records
- [Instructor] All right, in this lecture we're going to talk about updating existing records. So now you know how to create tables, you know how to add new records, sometimes you need to update existing records, and MySQL does this using an update statement. Our update statement will always require a set clause, which tells the server which values to set, and then in most cases we'll also include a where clause, which is optional, but highly recommended to specify which records to update. If we don't use a where clause, then the update is going to process on every record in the table. So again, where is optional, but really you're going to use the where almost every time unless you're doing an entire bulk update to every record that you have. So let's jump into Workbench and we can walk through an example. So again, we'll work in our thrift shop schema and I'll say select star from inventory just so that you guys can see everything that's in this table once again. So let's say that…
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
-
-
-
-
-
-
(Locked)
Inserting records into tables8m
-
(Locked)
Updating data records7m 33s
-
(Locked)
Challenge: Inserting and updating records1m 30s
-
(Locked)
Solution: Inserting and updating records7m 30s
-
(Locked)
Deleting specific records9m 41s
-
(Locked)
Deleting all records with TRUNCATE10m 28s
-
(Locked)
Challenge: Deleting records1m 32s
-
(Locked)
Solution: Deleting records8m 16s
-
(Locked)
-
-
-
-
-