The ‘UPDATE’ and ‘ALTER’ are the SQL (structured query language) commands. These two commands are used for the modifying data or metadata in relations database management system (RDBMS).
These two commands has specific role in SQL and other specifications. Here, I am describing the comparison between update and alter commands.
Let’s compare,
Update command vs Alter command in SQL Oracle [Tabular Form]
# | Content | UPDATE Command | ALTER Command |
01 | Basics of Update & Alter commands | ‘UPDATE’ command is used to the change or modify the value of column of existing table. | ‘ALTER’ command is used to modify the structure of the existing table. |
02 | SQL language type | ‘UPDATE’ is command of data manipulation language (DML). | ‘ALTER’ is command of data definition language (DDL). |
03 | Syntax of Update and Alter commands | UPDATE table_name SET column_name1= value1, column_name2= value2,…,column_nameN= valueN WHERE condition; | ALTER TABLE table_name ADD column_name datatype; |
04 | Basic Function | The ‘UPDATE’ command only changes the value of columns. The developer can update specific records using ‘WHERE’ clause. | With the help of the ‘ALTER’ command, you can add columns, rename columns, drop columns, add constraint to columns, and change the datatypes of columns. |
05 | Operation | This command works at the data of the table. | This command works at metadata of table or table structure. |
06 | Commit role | The ‘COMMIT’ command is required after the execution of of the ‘UPDATE’ statement to save the changes. | All DDL (i.e. ALTER) command are auto ‘COMMIT’ enabled. So, no explicit ‘COMMIT’ command is needed. |
These are the basics concepts of Update command vs Alter command in SQL. Hopefully, you have understood all the above points. So, don’t forget to learn this difference. Beacuses, it is mostly asked in interviews.
Read realted another interview question: What are the difference between DELETE, DROP and TRUNCATE commands in SQL?
If you have any points to enrich update vs alter commands, please comment below.
Thanks for Reading!
Read more related Informatica Power Center (IPC):
- List of Transformations in Informatica Power Center & IICS | Types
- Active transformation vs Passive transformation in Informatica | Examples
- Filter transformation vs Router transformation in Informatica
- Source qualifier (SQ) transformation and Joiner transformation in Informatica
- Joiner transformation vs Lookup transformation in Informatica
I have completed master in Electrical Power System. I work and write technical tutorials on the PLC, MATLAB programming, and Electrical on DipsLab.com portal.
Sharing my knowledge on this blog makes me happy. And sometimes I delve in Python programming.