Learn how triggers may be used to prevent changes to rows that have already been reconciled or should not be changed for other reasons.
- [Instructor] Triggers may also be used…to prevent changes to rows that have already been reconciled…or should not be changed for other reasons.…In this lesson, I'll be copying and pasting…from the chapter 10 exercise files,…and we're using the test database.…And so I'm just gonna come out here,…and I'm going to recreate the widgetSale table basically.…We're gonna drop the existing one,…and create a new one that has this reconciled column,…and I'm going to repopulate the table with one value,…or a true value in one of those reconciled rows,…and so we can see here that row two…has the reconciled flag set to one,…and the other ones are zero.…
Now I'm gonna go ahead here…and I'm going to create this trigger,…and we'll take a look at the trigger first.…This is a trigger that's before update.…Remember our last trigger was after insert.…This one is before update,…so when we go to update a row in the widgetSale table,…this code will run before the update can happen,…and in this code here, we see this select raise…raises a function that will raise an event in SQL,…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.