I'll call you back again for another video lecture on PostgreSQL.
And in this video, let's go ahead and learn how to delete one more of this item.
And we're going to reset this item to start sequentially from 1 to 3.
And so on.
Now let's go ahead and delete the last one which is Sarah.
So we can be able to add.
And it's going to continue for 123456 and so on.
Now go ahead and delete it because we have learned how to use the delete keyword.
So delete from.
Students.
And we're going to delete our where the students underscore ID is equal to four.
And let's go ahead and hit enter.
And that is deleted.
Go right in here and let's check it out.
And the ID four is gone.
Now, if I should go ahead and enter another, uh, student that is going to start from six.
All right.
Let's go ahead and see.
I want to add, uh, maybe another student.
Let's go ahead and check it out.
So I'll go back here or I will start from here and one of them.
So let me go ahead and use this.
So I'm going ahead and say insert into students.
And I'm going to specify the columns.
That is the first underscore name.
And uh last underscore name.
Because these are not going to be null.
And in the next one we have is our enrolled date and email.
So let's go ahead and say enroll underscore date and email.
All right.
So go ahead and close this.
And then we're going to add values.
So the next one is the values.
So I'm going to say the values.
So I want to give the value of the first name.
When we say the first name is going to be George and the next one is going to be Steve.
Remember it's going to be under the quotation mark.
And uh, the erode date is going to be 2092.
Okay.
So it's going to be date.
Enter the date.
And there was a 2092 and ten maybe 27.
And the next one is the email.
So I'm going to say this is uh Steve at uh yahoo.com.
All right.
So and this email should also be inside the quotation.
So G Steve at Law.com.
All right, now we'll go ahead and close this.
I'll put a semicolon at the end, and now I can go ahead and hit enter.
And we have a sorted list.
Now let's go ahead and check this out.
So you can see that this started from six because we've deleted a four and five.
And the six or the third one was actually deleted when it wanted to insert in a row, which doesn't
have, uh, the email or the ID.
Now let's go ahead and say I'm going to reset this so that it can start from one, two and three instead
of jumping to 6 or 7 if I insert another one.
So go ahead and delete this last one now.
So first of all let me go ahead and use the delete keyword.
So delete uh from to go ahead and say delete from students.
And um, where the ID.
We are students underscore ID is equal to six and hit enter.
And now let's go back and check it out.
We have deleted it.
Now if we want to set this what I need to do is I'll go back here and I'm going to show this request.
Now this is what is giving the problem.
This is because it's doing this based on the numbers that have been added.
So if you add multiple times which you always go back, what I'm going to make this to start from the
number which is the highest number.
And that is two.
Or if it is three or 4 or 5.
So we want to select the maximum number to start from the maximum number of variables on the database.
And if I want to do that or I need to do is to reset the PostgreSQL table sequence which is this the
workplace?
And if I want to do that, I'll go right in here and I'm going to say select.
Then I want to set the value.
And then I'll go ahead and copy this.
Copy this.
And I'm going to put that inside quotation mark.
Then put a comma.
Then I'll go ahead and select from the maximum.
So select from the maximum ID because that is very very important from students.
All right.
And now you go ahead and uh close this.
Put a semicolon at the end of this.
And let's hit enter.
And it says caller ID does not exist.
All right.
So this is supposed to be uh, students underscore ID and I just said ID.
All right.
Now go ahead and do that again or I need to do.
Okay.
Let's go ahead and select a set vowel and the core head under.
Push this which we copied before and put a comma.
And I'm going to say select a maximum from students not just ID from students underscore ID all right.
Students underscore ID from students.
And now plus semicolon at the end.
Now let's go ahead and check out this.
Now set interval two.
All right.
Now we have set this interval.
What we need to do is let's go ahead and uh enter again and went to and set this value again.
So we're going to copy this value which we deleted previously.
And I'll go back in here and press that.
Hit enter and I'll copy the second value right in here.
And I'll go right in here.
And paste that.
Now let's go ahead and hit enter.
And now with inserted this go.
Back right in here.
And now execute this.
And now you can see that Steve is now studying from.
Three and no longer 6 or 7.
So for now always if I add numbers it's going to.
Start from 345 know.
So let's go ahead and add one more number.
So I'm going to copy this I'm going to copy the first one then.
And I'm going to leave the last one now I'm going to set my values to different values okay.
So let me say we have the first name to be zindar.
So the first name is Zindar.
And, uh, the last name is, uh.
Hello.
And, uh, the next one is the dates.
So the dates is.
Equal to 2091.
All right.
And, uh, we say 505 is the month, and, uh, 20 is the day.
So right on the plus this, I thought this is supposed to be inside the quotation.
And let me say 20, 91, zero 520.
So put a comma and uh, we're going to leave the email or we go back and delete this email because we
added this column because we added a column.
Let's go ahead and said email is going to be Zen.
Zen.
Hello at, uh, zoho.com.
All right.
Go ahead and close this up.
Put a semicolon at the end of this square here and hit enter.
And we have entered that.
Now come back in here and execute this.
And you can see we have this situation and this is now three and four.
So I hope that is cool.
So go ahead and reset this.
If you have not programmed maybe you have deleted something and it's moving from the next one.
You go ahead and set the interval to start from the maximum ID on the table.
I hope that is cool.
So check it out and practice with it.
If you have any questions, go ahead and use the question and answer section.
And I'm going to get back to you as soon as possible.
Thank you so much and I'm good to see you in the next video lecture.