Today we are going to discuss about the Delete statement in SQL. So the Delete statement is used to delete the existing record in the table. How you know very well that I have today reports six report. Now, if you want to delete the record from the table, how can you delete it? This is the syntax. You have to use the delete, delete keyword wish table from students who are saying oh, I'm going to delete something from Deadman something means a row.
Okay, now I'm saying that we're conditioned to hear how I'm saying DELETE FROM students. Wear ID, that means s ID was one. That means I'm saying I'm going to delete a record from the table where the ID is one. So as you know you have one ID, this one sound good. I'm going to delete this row. Make sure you always delete the row you cannot delete the column.
Okay, now I'm saying Ctrl Enter. So execute your query and saying select static from student Control Enter. So now as you know, as you can see, you have just deleted the record but you be careful. If you are deleting the record from this specific table, you have to use the Red Cross the unique ID to delete the particular Record from a particular table. If you are not using the unique name or the unique ID, that means, as you can see you have one one record. If you are saying Oh, Billy, possible if I'm saying insert into students.
I'm not going to add. Now I'm saying values are few seconds so I can perform the Delete operation. Now I'm saying the values are is sexy. Now I'm saying x y Zed. Here I'm saying is my syntax control. Have I've just inserted the record and saying that select static from students record enter.
So now as you can see, you have to record the name sheezy. Now if I'm saying that select Oh sorry, delete, delete from students, where as name sorry, this is where this is where I have just changed my chemo that's why I'm facing the difficulties where as name equals to z. Now as you know we have to record with name shake z. So if you are doing this, that means you are going Believe the record. So now I have just deleted now I'm saying select the static from students and all enter. So now as you know, you have just deleted the two records.
So before deleting anything or before updating anything, you have to specify which record you are going to update or delete. So that's why while are deleting anything from the table, you have to use the unique column or the unique field or the unique number or suppose these are the auto generated number or automatically in because we use the auto increment. So that's why whenever you insert the record, it's automatically in three increment with one, so that's why it's showing as 234567. Okay, so now if I'm saying I want to delete the Record from students table without giving any weight loss. So now hit the Ctrl Enter. Now, use the Select static from students Control Enter.
So now as you can see you have deleted all the records from the tables. So you have to specify the where clause to delete or update the records so that's why Okay, so I think this is enough for later next session we are going to cover some of the topics link for watching