We can use the same alter table statement to drop a column using altar table table name, drop column,
and then a column name.
And just like with AD where the column portion that is optional, the word column, of course the column
name is required, but the word column is optional.
If we look at drop keep going drop column, that is also optional.
But I like to put it in there once again to be clearer.
So let's drop the column from companies, This phone column right now, let's drop that.
So it's as simple as alter table companies drop column phone, and that just has to be the name.
It can fit on one line here that has to be the name of a column.
All right.
So if I describe companies, we should see no trace of the phone column anymore.
It's just name, address, employee count.
If I select star from companies, it's entirely gone.
Now, that was a column full of null values.
What if I dropped like, the name column or the address column or employee count?
Let's do that.
Employee count has values in it.
It's not empty.
Let's do drop.
Column employee count.
And of course, this has to be spelled exactly right.
Right.
If I misspell it, it can't find it.
It gets me an error.
But if I do employee count that had values in it.
But my SQL doesn't care in the same way that when I drop a table or I drop an entire database, if there's
stuff in there, it's gone.
So same thing when I drop a column.
Now, if I select star from companies, which really did drop those two columns, they are gone.
So that's how we can use Ultra Table to drop columns.
But there's even more we can do with it coming up.