Difference between Alter and Update SQL

Artic-M00n picture Artic-M00n · Jul 2, 2012 · Viewed 90k times · Source

I am busy studying MySQL and I understand that update is used to update a record or row in a table. So what does alter do that is so different? Seems like they are the same.

Thanks, any help will be appreciated.

Answer

Joyce Babu picture Joyce Babu · Jul 2, 2012

ALTER is a DDL (Data Definition Language) statement. Whereas UPDATE is a DML (Data Manipulation Language) statement. ALTER is used to update the structure of the table (add/remove field/index etc). Whereas UPDATE is used to update data.