Introduction🤔
Sometimes, when dealing with tables in SQL, one might wonder how to manipulate the table's structure by adding, deleting or modifying columns or updating the existing data.

We will find answers to all such questions in this article on the ALTER vs UPDATE command.
Are you ready❓
Also read, Coalesce in SQL and Tcl Commands in SQL
🎯ALTER Command✅

The ALTER TABLE statement or alter command is a data definition language(DDL) command used to modify, add or delete columns in the existing table. It is used to change the definition of the table, or we can say it is used to alter the table's structure.
📌ALTER TABLE - ADD COLUMN
Use the given below syntax to add a column in a table➡
ALTER TABLE the_table_name ADD the_column_name datatype;
⚙️For example - the following SQL statement adds an "Address" column to the "Users" table➡
ALTER TABLE Users ADD Address varchar(255);
📌ALTER TABLE - DROP COLUMN
Use the given below syntax to delete a column in a table➡
ALTER TABLE the_table_name DROP COLUMN the_column_name;
⚙️For example - the following SQL statement deletes the "Address" column from the "Users" table➡
ALTER TABLE Users DROP COLUMN Address;
Note⚠️ - some database systems do not allow deleting a column that has a CHECK constraint. Also, SQL Server does not allow deleting the column that has a PRIMARY KEY or a FOREIGN KEY constraint.
📌ALTER TABLE - ALTER COLUMN
Use the given below syntax to change the data type of a column in a table➡
ALTER TABLE the_table_name ALTER COLUMN the_column_name datatype;
⚙️For example - the following SQL statement changes the data type of the "DOB" column in the "Persons" table➡
ALTER TABLE Persons ALTER COLUMN DOB year;
Now let us see the UPDATE command before moving on to the differences in ALTER vs UPDATE command.🏄