1. ALTER Command :
Alter SQL command is used to modify, delete or add a column to an existing table in a database. Alter is a Data Definition Language (DDL) statement.
UPDATE tableName SET column1Name=value1, column2Name=value2, ... WHERE columnXName=someValue
2. UPDATE Command :
Update command is used to update existing records in a database. Update is a Data Manipulation Language (DML) statement.
ALTER TABLE tableName ADD newColumnName dataTypeOfNewColumn ALTER TABLE tableName DROP COLUMN columnName ALTER TABLE tableName ALTER COLUMN columnName newDataType
Difference Between ALTER and UPDATE Command in SQL :
|SR.NO||ALTER Command||UPDATE Command|
|1||ALTER command is Data Definition Language (DDL).||UPDATE Command is a Data Manipulation Language (DML).|
|2||Alter command will perform the action on structure level and not on the data level.||Update command will perform on the data level.|
|3||ALTER Command is used to add, delete, modify the attributes of the relations (tables) in the database.||UPDATE Command is used to update existing records in a database.|
|4||ALTER Command by default initializes values of all the tuple as NULL.||UPDATE Command sets specified values in the command to the tuples.|
|5||This command make changes with table structure.||This command makes changes with data inside the table.|
|6||Example : Table structure, Table Name, SP, functions etc.||Example : Change data in the table in rows or in column etc.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between Deferred update and Immediate update
- SQL | ALTER (RENAME)
- SQL | ALTER (ADD, DROP, MODIFY)
- Create, Alter and Drop schema in MS SQL Server
- Difference between grep and fgrep command
- SQL | UPDATE Statement
- Update clause in Cassandra
- PHP | MySQL UPDATE Query
- Performing Database Operations in Java | SQL CREATE, INSERT, UPDATE, DELETE and SELECT
- Expand on command in Cassandra
- Difference between SDN and NFV
- Difference between DML and TCL
- Difference Between Blu-Ray and DVD
- Difference between C and C++
- Difference between ELT and ETL
- Difference between ADO and ADO.NET
- Difference between PNG and GIF
- What is the difference between GUI and CUI?
- Difference between URL and URI
- Difference between WCF and Web API
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.