Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,550 --> 00:00:08,560
Now in the last lesson we looked at how to update records in our tables and we looked at the SQL
2
00:00:08,650 --> 00:00:10,210
UPDATE statement.
3
00:00:10,240 --> 00:00:15,610
Now in this lesson we're going to look at the last letter of CRUD which is DELETE.
4
00:00:15,610 --> 00:00:24,460
And if we wanted to delete records then we can simply write DELETE FROM table name where something meets
5
00:00:24,490 --> 00:00:26,950
a certain condition.
6
00:00:26,960 --> 00:00:33,590
So for example if I want to delete my record of my pencil say if I no longer sell pencils anymore in
7
00:00:33,590 --> 00:00:47,030
my shop then I can simply say DELETE FROM products table where the name is equal to pencil or what would
8
00:00:47,030 --> 00:00:53,410
be better is if I actually use its id, where id is equal to 2. Now
9
00:00:53,430 --> 00:01:00,500
again be careful that you don't run the statement without a WHERE statement because that will delete
10
00:01:00,860 --> 00:01:05,870
everything in your products table and you'll end up losing all of the data.
11
00:01:06,050 --> 00:01:12,320
So it's again a dangerous statement to execute and make sure that you check your statement before you
12
00:01:12,320 --> 00:01:13,860
hit the run button.
13
00:01:15,150 --> 00:01:22,800
And now our products table only has one entry left. But through this process you've seen how we can use
14
00:01:23,070 --> 00:01:30,990
the Structured Query Language to Create, Read, Update and Delete data from our SQL table.
1614
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.