In this video lecture, we go ahead and learn how to add a column to our existing table.
So we have this table right here.
And we want to add a column.
And the column is going to be the age of the students.
And how come we would add that age.
So I want to add a column called age and that this table has existed.
And the how can we be able to do that so that this column age can be added to the existing table.
So I can actually go over here and start from the pgadmin to do that, or I move over to the show,
and all I have to do is to alter the table.
So go ahead and alter table and the name of the table is a students.
And then I use a command called add.
And I would add our.
Then select what I want to add and add what is called H.
That is the name of the column I want, and they have to specify the data type that is int and not a
decimal.
So easier integer data type right now plus a macron at the end.
And if I hit enter it can see all the table.
And let me go right here I say backslash d and the go ahead and hit this.
And I'm going to select the table slash D students and hit enter.
And I have H right in here.
And you can see the h integer is here already okay.
So I'm trying to refresh this from here.
And uh let's go ahead and start off from strings.
And if we should execute this command I should be able to see H right here.
So I'm trying to get that.
and that is here so you can see it.
It takes a longer time, maybe because I'm recording and that is why it was not able to come out immediately.
But you can see that uh h is already added after the email.
So I hope that is cool.
So this is how I can be able to add a column to an existing table.
And uh, you can also update that.
So we're also going to look on how to update these and how to work with our days.
So let's go ahead and uh practice what we just learned.
Add any of the column or any column you want to your existing database.
And uh using this procedure is going to work out fine.
Okay.
So that is it for now.
Try that out, learn with it.
And if you have a location, go ahead.
I used 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 going to see you in the next video lecture.