From the course: Advanced MySQL Database Administration
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Solution: Testing your trigger system - MySQL Tutorial
From the course: Advanced MySQL Database Administration
Solution: Testing your trigger system
- [Instructor] All right, this is the solution video for your assignment on testing your trigger. So in the previous assignment, we created a trigger to update the orders table anytime a new record was inserted into order items. In this assignment, we're going to be testing that trigger out by inserting data into the order items table and we'll also insert some data into the order item refunds table for the same time period, while we're at it. So let's jump into Workbench, and I'll walk you through this. All right, so before we do anything else, the first thing that I want to do is just get a good luck at what's going on in that orders table. And I think the main thing I want to know is the number of records that we have. So I'm just going to do a select count star from orders. And that's all we really need to do. And we see we have 10,033 records. I'm actually going to note that here just so it's easy and I don't forget the number. So this is 10,033 records before insert. And if…
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)
Review: Triggers basics8m 37s
-
(Locked)
Triggers deep dive34m 17s
-
(Locked)
Challenge: Creating and updating orders2m 7s
-
(Locked)
Solution: Creating and updating orders6m 35s
-
(Locked)
Challenge: Triggers2m 19s
-
(Locked)
Solution: Triggers5m 10s
-
(Locked)
Challenge: Testing your trigger system2m 9s
-
(Locked)
Solution: Testing your trigger system4m 4s
-
(Locked)
-
-
-
-
-
-