Learn how transactions work, what the syntax is for transactions, and how to roll back a partially complete transaction.
- [Instructor] The syntax for using transactions…in SQL is pretty simple.…In this example, I'll show you how to maintain…the integrity of your database by ensuring…that related statements are completed successfully…before they are committed to the database.…For this example, we're going to use the "test" database,…and I'm going to copy some SQL…from the Chapter Nine Exercise File.…I'm just going to copy and paste those lines in here.…First, we'll create a table…called widgetInventory…and a table called widgetSales.…
We'll insert some inventory into…the Inventory table,…and select from it,…so when I press Go, we see that we have onhand…25 units each of rock, paper, and scissors.…So, now we're going to create a transaction.…I'm going to come back out here to the…Exercise File.…I'm going to select…these six lines of SQL,…and paste that in here.…You notice the Begin Transaction statement.…That tells the system that all the statements…up to the End Transaction statement are to be treated…as one transactional unit.…
On some systems, Begin Transaction may…
- 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.